public final class StreamManager extends Object
| Constructor and Description |
|---|
StreamManager()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeAll()
Closes all handles streams and readers.
|
InputStream |
getInputStream(File f)
Returns an InputStream on the given file.
|
OutputStream |
getOutputStream(File f)
Returns an OutputStream on the given file.
|
InputStream |
handle(InputStream in)
Handles the received InputStream and returns it.
|
OutputStream |
handle(OutputStream out)
Handles the received OutputStream and returns it.
|
Reader |
handle(Reader r)
Handles the received Reader and returns it.
|
Writer |
handle(Writer w)
Handles the received Writer and returns it.
|
public InputStream handle(InputStream in)
in - The stream to be automatically closed when
closeAll() is called.public OutputStream handle(OutputStream out)
out - The stream to be automatically closed when
closeAll() is called.public Reader handle(Reader r)
r - The reader to be automatically closed when
closeAll() is called.public Writer handle(Writer w)
w - The writer to be automatically closed when
closeAll() is called.public InputStream getInputStream(File f) throws FileNotFoundException
f - The file attached to the returned stream
to be automatically closed when closeAll() is called.FileNotFoundException - If the file does not existspublic OutputStream getOutputStream(File f) throws FileNotFoundException
f - The file attached to the returned stream
to be automatically closed when closeAll() is called.FileNotFoundException - If the file does not existspublic void closeAll()
Copyright © 2013. All Rights Reserved.