DataBuffer interface that wraps a Netty 5
Buffer. Typically constructed with Netty5DataBufferFactory.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Buffer | |
| private final Netty5DataBufferFactory |
| Access | Constructor and Description |
|---|---|
| pack-priv | Netty5DataBuffer(Buffer
the buffer to base this buffer on buffer, Netty5DataBufferFactory dataBufferFactory)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | asByteBuffer()
Implements org.
Deprecated
Expose this buffer's bytes as a ByteBuffer.
|
| 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 ByteBuffer.
|
| public int | capacity()
Implements org. |
| public Netty5DataBuffer | capacity(int
the new capacity capacity)Implements org.
Deprecated
Set the number of bytes that this buffer can contain.
|
| public void | close()
Implements org. |
| public DataBuffer | ensureWritable(int
the writable capacity to check for capacity)Implements org. writableByteCount()
to write the amount of data given as an argument.
|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public DataBufferFactory | factory()
Implements org. DataBufferFactory that created this buffer.
|
| public byte | getByte(int
the index at which the byte will be read index)Implements org. |
| public Buffer | Returns: the wrapped bufferDirectly exposes the native |
| public int | |
| private static boolean | |
| public int | indexOf(IntPredicate
the predicate to match predicate, int the index to start the search from fromIndex)Implements org. |
| public int | lastIndexOf(IntPredicate
the predicate to match predicate, int the index to start the search from fromIndex)Implements org. |
| public byte | read()
Implements org. |
| public Netty5DataBuffer | read(byte[]
the array into which the bytes are to be written destination)Implements org. |
| public Netty5DataBuffer | 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. length bytes of this buffer into the specified destination,
starting at the current reading position of this buffer.
|
| public DataBuffer. | readableByteBuffers()
Implements org. ByteBuffer in this data
buffer that can be read.
|
| public int | readableByteCount()
Implements org. |
| public int | readPosition()
Implements org. |
| public Netty5DataBuffer | readPosition(int
the new read position readPosition)Implements org. |
| 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 DataBuffer whose contents is a shared subsequence of this
data buffer's content.
|
| public DataBuffer | split(int
the index at which it should be split index)Implements org. |
| public ByteBuffer | toByteBuffer(int index, int length)
Implements org.
Deprecated
Returns a ByteBuffer representation of a subsequence of this
buffer's bytes.
|
| 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. ByteBuffer, beginning at the given source position, and the
given destination position in the destination byte buffer.
|
| public String | toString(Charset
the character set to use charset)Overrides default org. |
| 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. |
| public String | |
| public Netty5DataBuffer | touch(Object hint)
Implements org. |
| public DataBuffer. | writableByteBuffers()
Implements org. ByteBuffer in this data
buffer that can be written to.
|
| public int | writableByteCount()
Implements org. |
| public Netty5DataBuffer | write(byte
the byte to be written b)Implements org. |
| public Netty5DataBuffer | write(byte[]
the bytes to be written into this buffer source)Implements org. |
| public Netty5DataBuffer | 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. length bytes of the given source into this buffer, starting
at the current writing position of this buffer.
|
| public Netty5DataBuffer | write(DataBuffer...
the byte buffers to write into this buffer dataBuffers)Implements org. DataBuffers to this buffer, starting at the current
writing position.
|
| public Netty5DataBuffer | write(ByteBuffer...
the byte buffers to write into this buffer buffers)Implements org. ByteBuffer to this buffer, starting at the current
writing position.
|
| public Netty5DataBuffer | |
| 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. CharSequence using the given Charset,
starting at the current writing position.
|
| public int | writePosition()
Implements org. |
| public Netty5DataBuffer | writePosition(int
the new write position writePosition)Implements org. |
| buffer | back to summary |
|---|---|
| private final Buffer buffer | |
| dataBufferFactory | back to summary |
|---|---|
| private final Netty5DataBufferFactory dataBufferFactory | |
| Netty5DataBuffer | back to summary |
|---|---|
| pack-priv Netty5DataBuffer(Buffer buffer, Netty5DataBufferFactory dataBufferFactory) 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
| |
| 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 Netty5DataBuffer 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.
| |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Closes this data buffer, freeing any resources.
| |
| ensureWritable | back to summary |
|---|---|
| public DataBuffer ensureWritable(int capacity) Implements org. Doc from org. Ensure that the current buffer has enough
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| 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.
| |
| getNativeBuffer | back to summary |
|---|---|
| public Buffer getNativeBuffer() Directly exposes the native
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasNetty5DataBuffers | back to summary |
|---|---|
| private static boolean hasNetty5DataBuffers(DataBuffer[] buffers) | |
| 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 Netty5DataBuffer 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 Netty5DataBuffer 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 Netty5DataBuffer readPosition(int readPosition) Implements org. Doc from org. Set the position from which this buffer will read.
| |
| 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
Note that due to the lack of a
| |
| 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(int index, int length) Implements org. Doc from org. Deprecated
Returns a
| |
| 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. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| touch | back to summary |
|---|---|
| public Netty5DataBuffer touch(Object hint) Implements org. Doc from org. Associate the given hint with the data buffer for debugging purposes.
| |
| 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 Netty5DataBuffer 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 Netty5DataBuffer 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 Netty5DataBuffer write(byte[] source, int offset, int length) Implements org. Doc from org. Write at most
| |
| write | back to summary |
|---|---|
| public Netty5DataBuffer write(DataBuffer... dataBuffers) Implements org. Doc from org. Write one or more
| |
| write | back to summary |
|---|---|
| public Netty5DataBuffer write(ByteBuffer... buffers) Implements org. Doc from org. Write one or more
| |
| write | back to summary |
|---|---|
| public Netty5DataBuffer write(Buffer... buffers) Writes one or more Netty 5
| |
| 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 Netty5DataBuffer writePosition(int writePosition) Implements org. Doc from org. Set the position to which this buffer will write.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ComponentIterator | |
| private T | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements org. |
| public boolean | |
| public ByteBuffer |
| delegate | back to summary |
|---|---|
| private final ComponentIterator<T> delegate | |
| next | back to summary |
|---|---|
| private T next
| |
| readable | back to summary |
|---|---|
| private final boolean readable | |
| BufferComponentIterator | back to summary |
|---|---|
| public BufferComponentIterator(ComponentIterator<T> delegate, boolean readable) | |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public ByteBuffer next() Implements java. Doc from java. Returns the next element in the iteration.
| |