Class CurrentByteBufferSink.Adapter

java.lang.Object
io.deephaven.io.streams.CurrentByteBufferSink.Adapter
All Implemented Interfaces:
ByteBufferSink, CurrentByteBufferSink
Enclosing interface:
CurrentByteBufferSink

public static class CurrentByteBufferSink.Adapter extends Object implements CurrentByteBufferSink
  • Constructor Details

  • Method Details

    • getBuffer

      public ByteBuffer getBuffer()
      Description copied from interface: CurrentByteBufferSink
      Access the current buffer for this sink. This is either the initial buffer, or the last one provided by ByteBufferSink.acceptBuffer(ByteBuffer, int)) or CurrentByteBufferSink.ensureSpace(int).
      Specified by:
      getBuffer in interface CurrentByteBufferSink
      Returns:
      The current buffer for this sink
    • acceptBuffer

      public ByteBuffer acceptBuffer(@NotNull @NotNull ByteBuffer buffer, int need) throws 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:
      IOException
    • close

      public void close(@NotNull @NotNull ByteBuffer buffer) throws 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:
      IOException