trait MessageSink extends AutoCloseable with Flushable
Provides a buffered output stream that writes sequence of WriteBuffer instances.
A Sink implementation has total control of the buffer memory so that it can reuse buffer memory, use buffer pools,
or use memory-mapped files.
Attributes
Graph
Supertypes
trait Flushable
trait AutoCloseable
class Object
trait Matchable
class Any
Members list
Concise view
Value members
Abstract methods
def add(buffer: Array[Byte], offset: Int, length: Int): Unit
Writes an external payload data.
Writes an external payload data.
Unlike int, int) method, the buffer is given - this
BufferSink implementation gets ownership of the buffer and may modify contents of the buffer. Contents of this
buffer won't be modified by the caller.
Allocates the next buffer for writing MessagePack data.
Allocates the next buffer for writing MessagePack data.
This method returns an WriteBuffer instance that
has specified size of capacity at least.
When this method is called twice, the previously returned buffer is
no longer used. This method may be called twice without call of writeBuffer in between. In this case, the
buffer should be discarded without flushing it to the output.
Attributes
minimumSize
the minimum required buffer size to allocate
Returns:
a Buffer instance with at least minimumSize bytes of capacity
def write(buffer: Array[Byte], offset: Int, length: Int): Unit
Writes an external payload data. This method should follow semantics of OutputStream.
Writes an external payload data. This method should follow semantics of OutputStream.
This method should write the buffer previously returned from
next method until specified number of bytes. Once the entire buffer contents is totally written to the
sink, the buffer should not be used because a BufferSink implementation might reuse the buffer.
This method is
not always called for each next call. In this case, the buffer should be discarded without flushing it to
the output when the next next is called.