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.
the data to add
the start offset in the data
the number of bytes to add
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(int) in between. In this case, the buffer should be discarded without flushing it to the output.
the minimum required buffer size to allocate
a Buffer instance with at least minimumSize bytes of capacity
Writes an external payload data.
Writes an external payload data. This method should follow semantics of OutputStream.
the data to write
the start offset in the data
the number of bytes to write
Writes the previously allocated buffer(s).
Writes the previously allocated buffer(s).
This method should write the buffer previously returned from next(int) 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(int) call. In this case, the buffer should be discarded without flushing it to the output when the next next(int) is called.
the number of bytes to write
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.