Buffer implementation that implements all buffer methods by delegating them to a wrapped buffer
instance.
This can be used when writing automated tests for code that integrates with Buffer, but should not be used in
production code.
| Access | Constructor and Description |
|---|---|
| public | BufferStub(Buffer
The buffer instance to delegate all method calls to. delegate)Create a new buffer stub that delegates all calls to the given instance. |
| Modifier and Type | Method and Description |
|---|---|
| public int | bytesBefore(byte
The byte value to search for. needle)Implements io. needle is found in this
buffer.
|
| public int | bytesBefore(Buffer
The buffer value to search for. needle)Implements io. needle is found in this
buffer.
|
| public int | capacity()
Implements io. |
| public void | |
| public Buffer | compact()
Implements io. |
| public Buffer | copy()
Overrides default io. |
| public Buffer | copy(int
The offset where copying should start from. This is the offset of the first byte copied. offset, int The number of bytes to copy, and the capacity of the returned buffer. length, boolean The desired readOnly)readOnly() state of the returned buffer.Implements io. |
| public Buffer | copy(int
The offset where copying should start from. This is the offset of the first byte copied. offset, int The number of bytes to copy, and the capacity of the returned buffer. length)Overrides default io. |
| public Buffer | copy(boolean
The desired readOnly)readOnly() state of the returned buffer.Overrides default io. |
| public void | copyInto(int
The byte offset into this buffer from where the copying should start; the byte at this offset in
this buffer will be copied to the srcPos, byte[] destPos index in the dest array.The destination byte array. dest, int The index into the destPos, int dest array from where the copying should start.The number of bytes to copy. length)Implements io. |
| public void | copyInto(int
The byte offset into this buffer from where the copying should start; the byte at this offset in
this buffer will be copied to the srcPos, ByteBuffer destPos index in the dest ByteBuffer.The destination byte buffer. dest, int The index into the destPos, int dest ByteBuffer from where the copying should start.The number of bytes to copy. length)Implements io. |
| public void | copyInto(int
The byte offset into this buffer from where the copying should start; the byte at this offset in
this buffer will be copied to the srcPos, Buffer destPos index in the dest buffer.The destination buffer. dest, int The index into the destPos, int dest buffer from where the copying should start.The number of bytes to copy. length)Implements io. |
| public int | countComponents()
Implements io. |
| public int | countReadableComponents()
Implements io. |
| public int | countWritableComponents()
Implements io. |
| public Buffer | ensureWritable(int
The requested number of bytes of space that should be available for writing. size)Overrides default io. |
| public Buffer | ensureWritable(int
The requested number of bytes of space that should be available for writing. size, int The minimum number of bytes to grow by. If it is determined that memory should be allocated
and copied, make sure that the new memory allocation is bigger than the old one by at least
this many bytes. This way, the buffer can grow by more than what is immediately necessary,
thus amortising the costs of allocating and copying. minimumGrowth, boolean allowCompaction)Implements io. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public Buffer | fill(byte
The byte value to write at every offset in the buffer. value)Implements io. |
| public <T extends BufferComponent & ComponentIterator. | forEachComponent()
Implements io. |
| public boolean | getBoolean(int
The read offset, an absolute offset into this buffer, to read from. roff)Overrides default io. |
| public byte | getByte(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public char | getChar(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public double | getDouble(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public float | getFloat(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public int | getInt(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public long | getLong(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public int | getMedium(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public short | getShort(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public int | getUnsignedByte(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public long | getUnsignedInt(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public int | getUnsignedMedium(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public int | getUnsignedShort(int
The read offset, an absolute offset into this buffer, to read from. roff)Implements io. |
| public int | |
| public Buffer | implicitCapacityLimit(int
The maximum size this buffers capacity will implicitly grow to via limit)write* methods.Implements io. |
| public int | implicitCapacityLimit()
Implements io. |
| public boolean | |
| public boolean | isDirect()
Implements io. |
| public Buffer | |
| public ByteCursor | openCursor()
Implements io. |
| public ByteCursor | openCursor(int
The offset into the buffer where iteration should start.
The first byte read from the iterator will be the byte at this offset. fromOffset, int The number of bytes to iterate. length)Implements io. |
| public ByteCursor | openReverseCursor()
Overrides default io. |
| public ByteCursor | openReverseCursor(int
The offset into the buffer where iteration should start.
The first byte read from the iterator will be the byte at this offset. fromOffset, int The number of bytes to iterate. length)Implements io. |
| public int | readableBytes()
Overrides default io. (writerOffset() - readerOffset()).
|
| public boolean | readBoolean()
Overrides default io. Buffer#readerOffset(),
and increases the reader offset by Byte#BYTES.
|
| public byte | readByte()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Byte#BYTES.
|
| public Buffer | readBytes(byte[]
The byte array to write into. destination, int Position in the destPos, int destination to where bytes should be written from this buffer.The number of bytes to copy. length)Overrides default io. |
| public Buffer | readBytes(ByteBuffer
The destination)ByteBuffer to write into.Overrides default io. ByteBuffer
This updates the read offset of this buffer and also the position of
the destination ByteBuffer.
|
| public char | readChar()
Implements io. Buffer#readerOffset(),
and increases the reader offset by 2.
|
| public CharSequence | readCharSequence(int
of length, Charset CharSequence to read.of the bytes to be read. charset)Overrides default io. CharSequence of the passed length using the passed Charset.
|
| public double | readDouble()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Double#BYTES.
|
| public int | |
| public Buffer | readerOffset(int
The reader offset to set. offset)Implements io. |
| public float | readFloat()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Float#BYTES.
|
| public int | readInt()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Integer#BYTES.
|
| public long | readLong()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Long#BYTES.
|
| public int | readMedium()
Implements io. Buffer#readerOffset(),
and increases the reader offset by 3.
|
| public boolean | |
| public short | readShort()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Short#BYTES.
|
| public Buffer | readSplit(int length)
Overrides default io. length number of bytes from the current
reader offset position.
|
| public int | readUnsignedByte()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Byte#BYTES.
|
| public long | readUnsignedInt()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Integer#BYTES.
|
| public int | readUnsignedMedium()
Implements io. Buffer#readerOffset(),
and increases the reader offset by 3.
|
| public int | readUnsignedShort()
Implements io. Buffer#readerOffset(),
and increases the reader offset by Short#BYTES.
|
| public Buffer | resetOffsets()
Overrides default io. |
| public Send | send()
Implements io. |
| public Buffer | setBoolean(int
The write offset, an absolute offset into this buffer to write to. woff, boolean The boolean value to write. value)Overrides default io. |
| public Buffer | setByte(int
The write offset, an absolute offset into this buffer to write to. woff, byte The byte value to write. value)Implements io. |
| public Buffer | setChar(int
The write offset, an absolute offset into this buffer to write to. woff, char The char value to write. value)Implements io. |
| public Buffer | setDouble(int
The write offset, an absolute offset into this buffer to write to. woff, double The double value to write. value)Implements io. |
| public Buffer | setFloat(int
The write offset, an absolute offset into this buffer to write to. woff, float The float value to write. value)Implements io. |
| public Buffer | setInt(int
The write offset, an absolute offset into this buffer to write to. woff, int The int value to write. value)Implements io. |
| public Buffer | setLong(int
The write offset, an absolute offset into this buffer to write to. woff, long The long value to write. value)Implements io. |
| public Buffer | setMedium(int
The write offset, an absolute offset into this buffer to write to. woff, int The int value to write. value)Implements io. |
| public Buffer | setShort(int
The write offset, an absolute offset into this buffer to write to. woff, short The short value to write. value)Implements io. |
| public Buffer | setUnsignedByte(int
The write offset, an absolute offset into this buffer to write to. woff, int The int value to write. value)Implements io. |
| public Buffer | setUnsignedInt(int
The write offset, an absolute offset into this buffer to write to. woff, long The long value to write. value)Implements io. |
| public Buffer | setUnsignedMedium(int
The write offset, an absolute offset into this buffer to write to. woff, int The int value to write. value)Implements io. |
| public Buffer | setUnsignedShort(int
The write offset, an absolute offset into this buffer to write to. woff, int The int value to write. value)Implements io. |
| public Buffer | skipReadableBytes(int
to accumulate. delta)Overrides default io. |
| public Buffer | skipWritableBytes(int
to accumulate. delta)Overrides default io. |
| public Buffer | split()
Overrides default io. |
| public Buffer | split(int
The offset into this buffer where it should be split. After the split, the data at this offset
will be at offset zero in this buffer. splitOffset)Implements io. splitOffset.
|
| public String | toString(Charset
used for decoding. charset)Overrides default io. |
| public Buffer | touch(Object
An optional hint about this access and its context. May be hint)null.Overrides default io. |
| public int | transferFrom(FileChannel
The channel to read from. channel, long The file position. position, int The maximum number of bytes to read. length)Implements io. |
| public int | transferFrom(ReadableByteChannel
The channel to read from. channel, int The maximum number of bytes to read. length)Implements io. |
| public int | transferTo(WritableByteChannel
The channel to write to. channel, int The maximum number of bytes to write. length)Implements io. |
| public int | writableBytes()
Overrides default io. (capacity() - writerOffset()).
|
| public Buffer | writeBoolean(boolean
The boolean value to write. value)Overrides default io. Buffer#writerOffset(),
and increase the writer offset by Byte#BYTES.
|
| public Buffer | writeByte(byte
The byte value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Byte#BYTES.
|
| public Buffer | writeBytes(Buffer
The buffer to read from. source)Overrides default io. |
| public Buffer | writeBytes(byte[]
The byte array to read from. source)Overrides default io. |
| public Buffer | writeBytes(byte[]
The byte array to read from. source, int Position in the srcPos, int source from where bytes should be written to this buffer.The number of bytes to copy. length)Overrides default io. |
| public Buffer | writeBytes(ByteBuffer
The source)ByteBuffer to read from.Overrides default io. ByteBuffer.
|
| public Buffer | writeChar(char
The char value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by 2.
|
| public Buffer | writeCharSequence(CharSequence
CharSequence to read from.Charset to use for writing.Overrides default io. source using the passed charset.
|
| public Buffer | writeDouble(double
The double value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Double#BYTES.
|
| public Buffer | writeFloat(float
The float value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Float#BYTES.
|
| public Buffer | writeInt(int
The int value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Integer#BYTES.
|
| public Buffer | writeLong(long
The long value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Long#BYTES.
|
| public Buffer | writeMedium(int
The int value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by 3.
|
| public int | |
| public Buffer | writerOffset(int
The writer offset to set. offset)Implements io. |
| public Buffer | writeShort(short
The short value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Short#BYTES.
|
| public Buffer | writeSplit(int length)
Overrides default io. length number of bytes from the current
writer offset position.
|
| public Buffer | writeUnsignedByte(int
The int value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Byte#BYTES.
|
| public Buffer | writeUnsignedInt(long
The long value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Integer#BYTES.
|
| public Buffer | writeUnsignedMedium(int
The int value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by 3.
|
| public Buffer | writeUnsignedShort(int
The int value to write. value)Implements io. Buffer#writerOffset(),
and increase the writer offset by Short#BYTES.
|