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 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