pal.io
Class InputSource

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by java.io.PushbackReader
              extended by pal.io.InputSource
All Implemented Interfaces:
java.io.Closeable, 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
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
read, read
 
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