public interface ByteBufferDestination
Encoders write binary data to. It encapsulates a
drain()method the producer can call when the
This interface allows a producer to write arbitrary amounts of data to a destination.
|Modifier and Type||Method and Description|
Consumes the buffer content and returns a buffer with more available space (which may or may not be the same instance).
Returns the buffer to write to.
Writes the given data to this ByteBufferDestination.
Writes the given data to this ByteBufferDestination entirely.
ByteBuffer drain(ByteBuffer buf)
Called by the producer when buffer becomes too full to write to.
buf- the buffer to drain
void writeBytes(ByteBuffer data)
void writeBytes(byte data, int offset, int length)
This method should behave identically to
writeBytes(ByteBuffer.wrap(data, offset, length).
It is provided to allow callers not to generate extra garbage.
This method is called writeBytes() to avoid clashing with
OutputStreamManager.write(byte, int, int),
which might be overridden in user-defined subclasses as protected, hence adding it to interface and requiring
the method to be public breaks source compatibility.
Copyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.