Package pal.io

Class InputSource

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable

    public class InputSource
    extends java.io.PushbackReader
    convenience class to open input streams linked to files, stdin, and strings
    Version:
    $Id: InputSource.java,v 1.4 2001/07/13 14:39:13 korbinian Exp $
    Author:
    Korbinian Strimmer
    • Field Summary

      • Fields inherited from class java.io.FilterReader

        in
      • Fields inherited from class java.io.Reader

        lock
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static InputSource openFile​(java.lang.String name)
      open file for reading
      static InputSource openStdIn()
      open standard input
      static InputSource openString​(java.lang.String input)
      "open" string for reading
      • Methods inherited from class java.io.PushbackReader

        close, mark, markSupported, read, read, ready, reset, skip, unread, unread, unread
      • Methods inherited from class java.io.Reader

        nullReader, read, read, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • openFile

        public static InputSource openFile​(java.lang.String name)
                                    throws java.io.FileNotFoundException
        open file for reading
        Parameters:
        name - file name
        Returns:
        input stream
        Throws:
        java.io.FileNotFoundException
      • openStdIn

        public static InputSource openStdIn()
        open standard input
        Returns:
        input stream
      • openString

        public static InputSource openString​(java.lang.String input)
        "open" string for reading
        Parameters:
        input - string serving as source
        Returns:
        input stream