|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.jnrpe.utils.StreamManager
public final class StreamManager
Utility class for handling streams.
| Constructor Summary | |
|---|---|
StreamManager()
Default constructor. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamManager()
| Method Detail |
|---|
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 exists
public 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||