|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.util.file.ReaderWrapper
public class ReaderWrapper
A wrapped reader. It may wrap a regular file, the standard input
stream, or any other Reader instance. This wrapper is
intended to wrap Reader instances for use with CloseableRegistry, hence such instances should not be closed
directly, that is, without going through the wrapper's close() method.
| Constructor Summary | |
|---|---|
ReaderWrapper(File file)
Creates a new wrapped reader that wraps the given regular file. |
|
ReaderWrapper(File file,
DecodingStrategy decodingStrategy)
Creates a new wrapped reader that wraps the given regular file. |
|
ReaderWrapper(Reader reader)
Creates a new wrapped reader that wraps the given reader. |
|
ReaderWrapper(Reader reader,
boolean skipClose)
Creates a new wrapped reader that wraps the given reader. |
|
ReaderWrapper(String name)
Creates a new wrapped reader that wraps the regular file with the given name, or the standard input stream (if the name is SpecialNames.STANDARD_INPUT). |
|
ReaderWrapper(String name,
DecodingStrategy decodingStrategy)
Creates a new wrapped reader that wraps the regular file with the given name, or the standard input stream (if the name is SpecialNames.STANDARD_INPUT). |
|
| Method Summary | |
|---|---|
void |
close()
|
Reader |
getReader()
Returns the receiver's underlying reader. |
boolean |
getSkipClose()
Returns true if the receiver's underlying reader will not be closed when close() is called. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReaderWrapper(String name,
DecodingStrategy decodingStrategy)
throws FileNotFoundException
SpecialNames.STANDARD_INPUT). A reader that recognizes
unicode BOMs is used as a proxy; that reader uses the given
decoding strategy.
name - The file name.decodingStrategy - The decoding strategy. It may be null
to use the default JVM charset.
FileNotFoundException - Thrown if the name represents a
regular file, and it cannot be opened for reading.
public ReaderWrapper(String name)
throws FileNotFoundException
SpecialNames.STANDARD_INPUT). The default JVM charset
is used to convert bytes into characters.
name - The file name.
FileNotFoundException - Thrown if the name represents a
regular file, and it cannot be opened for reading.
public ReaderWrapper(File file,
DecodingStrategy decodingStrategy)
throws FileNotFoundException
file - The file.decodingStrategy - The decoding strategy. It may be null
to use the default JVM charset.
FileNotFoundException - Thrown if the file cannot be
opened for reading.
public ReaderWrapper(File file)
throws FileNotFoundException
file - The file.
FileNotFoundException - Thrown if the file cannot be
opened for reading.
public ReaderWrapper(Reader reader,
boolean skipClose)
close() is
called depending on the given flag.
reader - The reader.skipClose - True if the underlying reader should not be
closed.public ReaderWrapper(Reader reader)
close() is
called; hence the given reader should not wrap the standard
input stream.
reader - The reader.| Method Detail |
|---|
public void close()
throws IOException
close in interface CloseableIOExceptionpublic Reader getReader()
public boolean getSkipClose()
close() is called.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||