DataBuffer interface
that can be overridden to adapt the delegate.
These methods default to calling through to the wrapped delegate object.
| Modifier and Type | Field and Description |
|---|---|
| private final DataBuffer |
| Access | Constructor and Description |
|---|---|
| public | DataBufferWrapper(DataBuffer
the buffer to wrap delegate)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | asByteBuffer()
Implements org.
Deprecated
Expose this buffer's bytes as a |
| public ByteBuffer | asByteBuffer(int
the index at which to start the byte buffer index, int the length of the returned byte buffer length)Implements org.
Deprecated
Expose a subsequence of this buffer's bytes as a |
| public InputStream | asInputStream()
Overrides default org. Expose this buffer's data as an |
| public InputStream | asInputStream(boolean releaseOnClose)
Overrides default org. Expose this buffer's data as an |
| public OutputStream | asOutputStream()
Overrides default org. Expose this buffer's data as an |
| public int | capacity()
Implements org. Return the number of bytes that this buffer can contain. |
| public DataBuffer | capacity(int
the new capacity capacity)Implements org.
Deprecated
Set the number of bytes that this buffer can contain. |
| public DataBuffer | |
| public DataBuffer | ensureCapacity(int
the writable capacity to check for capacity)Overrides default org.
Deprecated
Ensure that the current buffer has enough |
| public DataBuffer | ensureWritable(int
the writable capacity to check for capacity)Implements org. Ensure that the current buffer has enough |
| public DataBufferFactory | factory()
Implements org. Return the |
| public byte | getByte(int
the index at which the byte will be read index)Implements org. Read a single byte at the given index from this data buffer. |
| public int | indexOf(IntPredicate
the predicate to match predicate, int the index to start the search from fromIndex)Implements org. Return the index of the first byte in this buffer that matches the given predicate. |
| public int | lastIndexOf(IntPredicate
the predicate to match predicate, int the index to start the search from fromIndex)Implements org. Return the index of the last byte in this buffer that matches the given predicate. |
| public byte | read()
Implements org. Read a single byte from the current reading position from this data buffer. |
| public DataBuffer | read(byte[]
the array into which the bytes are to be written destination)Implements org. Read this buffer's data into the specified destination, starting at the current reading position of this buffer. |
| public DataBuffer | read(byte[]
the array into which the bytes are to be written destination, int the index within offset, int destination of the first byte to be writtenthe maximum number of bytes to be written in length)destinationImplements org. Read at most |
| public DataBuffer. | readableByteBuffers()
Implements org. Returns a closeable iterator over each |
| public int | readableByteCount()
Implements org. Return the number of bytes that can be read from this data buffer. |
| public int | readPosition()
Implements org. Return the position from which this buffer will read. |
| public DataBuffer | readPosition(int
the new read position readPosition)Implements org. Set the position from which this buffer will read. |
| public DataBuffer | retainedSlice(int
the index at which to start the slice index, int the length of the slice length)Overrides default org.
Deprecated
Create a new |
| public DataBuffer | slice(int
the index at which to start the slice index, int the length of the slice length)Implements org.
Deprecated
Create a new |
| public DataBuffer | split(int
the index at which it should be split index)Implements org. Splits this data buffer into two at the given index. |
| public ByteBuffer | toByteBuffer()
Overrides default org.
Deprecated
Returns a |
| public ByteBuffer | toByteBuffer(int index, int length)
Implements org.
Deprecated
Returns a |
| public void | toByteBuffer(ByteBuffer
the destination byte buffer dest)Overrides default org. Copies this entire data buffer into the given destination
|
| public void | toByteBuffer(int
the position of this data buffer from where copying should start srcPos, ByteBuffer the destination byte buffer dest, int the position in destPos, int dest to where copying should startthe amount of data to copy length)Implements org. Copies the given length from this data buffer into the given destination
|
| public String | toString(Charset
the character set to use charset)Overrides default org. Return this buffer's data a String using the specified charset. |
| public String | toString(int
the index at which to start the string index, int the number of bytes to use for the string length, Charset the charset to use charset)Implements org. Return a part of this buffer's data as a String using the specified charset. |
| public DataBuffer. | writableByteBuffers()
Implements org. Returns a closeable iterator over each |
| public int | writableByteCount()
Implements org. Return the number of bytes that can be written to this data buffer. |
| public DataBuffer | write(byte
the byte to be written b)Implements org. Write a single byte into this buffer at the current writing position. |
| public DataBuffer | write(byte[]
the bytes to be written into this buffer source)Implements org. Write the given source into this buffer, starting at the current writing position of this buffer. |
| public DataBuffer | write(byte[]
the bytes to be written into this buffer source, int the index within offset, int source to start writing fromthe maximum number of bytes to be written from length)sourceImplements org. Write at most |
| public DataBuffer | write(DataBuffer...
the byte buffers to write into this buffer buffers)Implements org. Write one or more |
| public DataBuffer | write(ByteBuffer...
the byte buffers to write into this buffer buffers)Implements org. Write one or more |
| public DataBuffer | write(CharSequence
the char sequence to write into this buffer charSequence, Charset the charset to encode the char sequence with charset)Overrides default org. Write the given |
| public int | writePosition()
Implements org. Return the position to which this buffer will write. |
| public DataBuffer | writePosition(int
the new write position writePosition)Implements org. Set the position to which this buffer will write. |
| delegate | back to summary |
|---|---|
| private final DataBuffer delegate | |
| DataBufferWrapper | back to summary |
|---|---|
| public DataBufferWrapper(DataBuffer delegate) Create a new
| |
| asByteBuffer | back to summary |
|---|---|
| public ByteBuffer asByteBuffer() Implements org. Doc from org. Deprecated
Expose this buffer's bytes as a
| |
| asByteBuffer | back to summary |
|---|---|
| public ByteBuffer asByteBuffer(int index, int length) Implements org. Doc from org. Deprecated
Expose a subsequence of this buffer's bytes as a
| |
| asInputStream | back to summary |
|---|---|
| public InputStream asInputStream() Overrides default org. Doc from org. Expose this buffer's data as an
| |
| asInputStream | back to summary |
|---|---|
| public InputStream asInputStream(boolean releaseOnClose) Overrides default org. Doc from org. Expose this buffer's data as an
| |
| asOutputStream | back to summary |
|---|---|
| public OutputStream asOutputStream() Overrides default org. Doc from org. Expose this buffer's data as an
| |
| capacity | back to summary |
|---|---|
| public int capacity() Implements org. Doc from org. Return the number of bytes that this buffer can contain.
| |
| capacity | back to summary |
|---|---|
| public DataBuffer capacity(int capacity) Implements org. Doc from org. Deprecated
Set the number of bytes that this buffer can contain. If the new capacity is lower than the current capacity, the contents of this buffer will be truncated. If the new capacity is higher than the current capacity, it will be expanded.
| |
| dataBuffer | back to summary |
|---|---|
| public DataBuffer dataBuffer() Return the wrapped delegate. | |
| ensureCapacity | back to summary |
|---|---|
| public DataBuffer ensureCapacity(int capacity) Overrides default org. Doc from org. Deprecated
Ensure that the current buffer has enough
| |
| ensureWritable | back to summary |
|---|---|
| public DataBuffer ensureWritable(int capacity) Implements org. Doc from org. Ensure that the current buffer has enough
| |
| factory | back to summary |
|---|---|
| public DataBufferFactory factory() Implements org. Doc from org. Return the
| |
| getByte | back to summary |
|---|---|
| public byte getByte(int index) Implements org. Doc from org. Read a single byte at the given index from this data buffer.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(IntPredicate predicate, int fromIndex) Implements org. Doc from org. Return the index of the first byte in this buffer that matches the given predicate.
| |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(IntPredicate predicate, int fromIndex) Implements org. Doc from org. Return the index of the last byte in this buffer that matches the given predicate.
| |
| read | back to summary |
|---|---|
| public byte read() Implements org. Doc from org. Read a single byte from the current reading position from this data buffer.
| |
| read | back to summary |
|---|---|
| public DataBuffer read(byte[] destination) Implements org. Doc from org. Read this buffer's data into the specified destination, starting at the current reading position of this buffer.
| |
| read | back to summary |
|---|---|
| public DataBuffer read(byte[] destination, int offset, int length) Implements org. Doc from org. Read at most
| |
| readableByteBuffers | back to summary |
|---|---|
| public DataBuffer. Implements org. Doc from org. Returns a closeable iterator over each Note that the returned iterator must be used in a try-with-resources clause or explicitly closed.
| |
| readableByteCount | back to summary |
|---|---|
| public int readableByteCount() Implements org. Doc from org. Return the number of bytes that can be read from this data buffer.
| |
| readPosition | back to summary |
|---|---|
| public int readPosition() Implements org. Doc from org. Return the position from which this buffer will read.
| |
| readPosition | back to summary |
|---|---|
| public DataBuffer readPosition(int readPosition) Implements org. Doc from org. Set the position from which this buffer will read.
| |
| retainedSlice | back to summary |
|---|---|
| public DataBuffer retainedSlice(int index, int length) Overrides default org. Doc from org. Deprecated
Create a new Note that unlike
| |
| slice | back to summary |
|---|---|
| public DataBuffer slice(int index, int length) Implements org. Doc from org. Deprecated
Create a new Note that this method will not call
| |
| split | back to summary |
|---|---|
| public DataBuffer split(int index) Implements org. Doc from org. Splits this data buffer into two at the given index. Data that precedes the The read and
write position of the returned buffer are
truncated to fit within the buffers capacity if
necessary. The positions of this buffer are set to
| |
| toByteBuffer | back to summary |
|---|---|
| public ByteBuffer toByteBuffer() Overrides default org. Doc from org. Deprecated
Returns a
| |
| toByteBuffer | back to summary |
|---|---|
| public ByteBuffer toByteBuffer(int index, int length) Implements org. Doc from org. Deprecated
Returns a
| |
| toByteBuffer | back to summary |
|---|---|
| public void toByteBuffer(ByteBuffer dest) Overrides default org. Doc from org. Copies this entire data buffer into the given destination
| |
| toByteBuffer | back to summary |
|---|---|
| public void toByteBuffer(int srcPos, ByteBuffer dest, int destPos, int length) Implements org. Doc from org. Copies the given length from this data buffer into the given destination
| |
| toString | back to summary |
|---|---|
| public String toString(Charset charset) Overrides default org. Doc from org. Return this buffer's data a String using the specified charset. Default implementation
delegates to | |
| toString | back to summary |
|---|---|
| public String toString(int index, int length, Charset charset) Implements org. Doc from org. Return a part of this buffer's data as a String using the specified charset. | |
| writableByteBuffers | back to summary |
|---|---|
| public DataBuffer. Implements org. Doc from org. Returns a closeable iterator over each Note that the returned iterator must be used in a try-with-resources clause or explicitly closed.
| |
| writableByteCount | back to summary |
|---|---|
| public int writableByteCount() Implements org. Doc from org. Return the number of bytes that can be written to this data buffer.
| |
| write | back to summary |
|---|---|
| public DataBuffer write(byte b) Implements org. Doc from org. Write a single byte into this buffer at the current writing position.
| |
| write | back to summary |
|---|---|
| public DataBuffer write(byte[] source) Implements org. Doc from org. Write the given source into this buffer, starting at the current writing position of this buffer.
| |
| write | back to summary |
|---|---|
| public DataBuffer write(byte[] source, int offset, int length) Implements org. Doc from org. Write at most
| |
| write | back to summary |
|---|---|
| public DataBuffer write(DataBuffer... buffers) Implements org. Doc from org. Write one or more
| |
| write | back to summary |
|---|---|
| public DataBuffer write(ByteBuffer... buffers) Implements org. Doc from org. Write one or more
| |
| write | back to summary |
|---|---|
| public DataBuffer write(CharSequence charSequence, Charset charset) Overrides default org. Doc from org. Write the given
| |
| writePosition | back to summary |
|---|---|
| public int writePosition() Implements org. Doc from org. Return the position to which this buffer will write.
| |
| writePosition | back to summary |
|---|---|
| public DataBuffer writePosition(int writePosition) Implements org. Doc from org. Set the position to which this buffer will write.
| |