Class CurrentByteBufferSink.Adapter

    • Constructor Summary

      Constructors 
      Constructor Description
      Adapter​(ByteBufferSink innerSink, java.nio.ByteBuffer initialBuffer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer acceptBuffer​(java.nio.ByteBuffer buffer, int need)
      Dispose of the contents of the buffer b, probably by writing them to a channel, and return a new buffer in which writing can continue.
      void close​(java.nio.ByteBuffer buffer)
      Dispose of the contents of the final buffer in an output sequence, probably by writing them to a channel.
      java.nio.ByteBuffer getBuffer()
      Access the current buffer for this sink.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Adapter

        public Adapter​(@NotNull
                       ByteBufferSink innerSink,
                       @NotNull
                       java.nio.ByteBuffer initialBuffer)
    • Method Detail

      • acceptBuffer

        public java.nio.ByteBuffer acceptBuffer​(@NotNull
                                                java.nio.ByteBuffer buffer,
                                                int need)
                                         throws java.io.IOException
        Description copied from interface: ByteBufferSink
        Dispose of the contents of the buffer b, probably by writing them to a channel, and return a new buffer in which writing can continue. The returned buffer must have at least need bytes of space remaining. The return value may be the same buffer, as long as it's remaining() value has been increased to be >= need.
        Specified by:
        acceptBuffer in interface ByteBufferSink
        Parameters:
        buffer - the buffer whose contents need to be disposed of.
        Returns:
        the buffer in which further output should be written.
        Throws:
        java.io.IOException
      • close

        public void close​(@NotNull
                          java.nio.ByteBuffer buffer)
                   throws java.io.IOException
        Description copied from interface: ByteBufferSink
        Dispose of the contents of the final buffer in an output sequence, probably by writing them to a channel. Note that the argument buffer may be empty. Then do whatever it takes to release the resources of the sink, probably by closing a channel.
        Specified by:
        close in interface ByteBufferSink
        Throws:
        java.io.IOException