|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.util.file.InputStreamWrapper
public class InputStreamWrapper
A wrapped input stream. It may wrap a regular file, the standard
input stream, or any other InputStream instance. This
wrapper is intended to wrap InputStream 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 | |
|---|---|
InputStreamWrapper(File file)
Creates a new wrapped stream that wraps the given regular file. |
|
InputStreamWrapper(InputStream stream)
Creates a new wrapped stream that wraps the given stream. |
|
InputStreamWrapper(InputStream stream,
boolean skipClose)
Creates a new wrapped stream that wraps the given stream. |
|
InputStreamWrapper(String name)
Creates a new wrapped stream 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()
|
boolean |
getSkipClose()
Returns true if the receiver's underlying stream will not be closed when close() is called. |
InputStream |
getStream()
Returns the receiver's underlying stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InputStreamWrapper(String name)
throws FileNotFoundException
SpecialNames.STANDARD_INPUT).
name - The file name.
FileNotFoundException - Thrown if the name represents a
regular file, and it cannot be opened for reading.
public InputStreamWrapper(File file)
throws FileNotFoundException
file - The file.
FileNotFoundException - Thrown if the file cannot be
opened for reading.
public InputStreamWrapper(InputStream stream,
boolean skipClose)
close() is called
depending on the given flag.
stream - The stream.skipClose - True if the underlying stream should not be
closed.public InputStreamWrapper(InputStream stream)
close() is
called; hence the given stream should not wrap (or be) the
standard input stream.
stream - The stream.| Method Detail |
|---|
public void close()
throws IOException
close in interface CloseableIOExceptionpublic InputStream getStream()
public boolean getSkipClose()
close() is called.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||