Package org.daisy.dotify.common.io
Interface StreamJuggler
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ByteArrayStreamJuggler
public interface StreamJuggler extends Closeable
Provides a juggler for streams.
This interface can be used to limit the code needed to handle temporary streams in a sequence of read/write operations. After each step (stream written) the juggler can be reset by calling reset() and the streams are ready to be used again. Very convenient together with optional steps.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStreamMaker
getInputStreamMaker()
Get the current input stream maker.OutputStream
getOutputStream()
Get the current output stream.void
reset()
Resets the input and output stream so that the input contains the written result and the output is cleared.
-
-
-
Method Detail
-
getInputStreamMaker
InputStreamMaker getInputStreamMaker()
Get the current input stream maker.- Returns:
- Returns the current input stream or null if StreamJuggler has been closed
-
getOutputStream
OutputStream getOutputStream() throws IOException
Get the current output stream.- Returns:
- Returns the current output stream or null if StreamJuggler has been closed
- Throws:
IOException
- if an IO-problem occurs
-
reset
void reset() throws IOException
Resets the input and output stream so that the input contains the written result and the output is cleared.- Throws:
IOException
- throws IOException
-
-