Interface CurrentByteBufferSink

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()
      Convenience close method.
      default java.nio.ByteBuffer ensureSpace​(int need)
      Return the current buffer, guaranteed to have sufficient space remaining to append the requested number of bytes.
      default void flush()
      Cause the current buffer to be accepted if it has any contents that aren't yet accepted into the sink.
      java.nio.ByteBuffer getBuffer()
      Access the current buffer for this sink.
    • Method Detail

      • ensureSpace

        default java.nio.ByteBuffer ensureSpace​(int need)
                                         throws java.io.IOException
        Return the current buffer, guaranteed to have sufficient space remaining to append the requested number of bytes. The existing current buffer may be accepted (see ByteBufferSink.acceptBuffer(ByteBuffer, int)) as a side effect of this operation.
        Parameters:
        need - The number of bytes required to proceed
        Returns:
        The current buffer for further output
        Throws:
        java.io.IOException
      • flush

        default void flush()
                    throws java.io.IOException
        Cause the current buffer to be accepted if it has any contents that aren't yet accepted into the sink.
        Throws:
        java.io.IOException