Interface CompositeBufferData
- All Superinterfaces:
BufferData
Composite (mutable) buffer data.
-
Field Summary
Fields inherited from interface BufferData
EMPTY_BYTES -
Method Summary
Modifier and TypeMethodDescriptionadd(BufferData bufferData) Add this buffer to the list of buffers already in this composite buffer.Methods inherited from interface BufferData
asInputStream, available, capacity, clear, consumed, copy, debugDataBinary, debugDataHex, debugDataHex, forEach, get, indexOf, lastIndexOf, lastIndexOf, read, read, read, readBytes, readFrom, readFrom, readHpackInt, readInt16, readInt24, readInt32, readLong, readString, readString, readUnsignedInt32, reset, rewind, skip, trim, write, write, write, write, write, writeAscii, writeHpackInt, writeInt16, writeInt24, writeInt32, writeInt64, writeInt8, writeTo, writeTo, writeUnsignedInt32Modifier and TypeMethodDescriptiondefault InputStreamDeprecated, for removal: This API element is subject to removal in a future version.this method will be removed without replacementintNumber of bytes available for reading.intcapacity()Number of bytes that can be written to this instance.clear()Reset read and write position and make the buffer empty.booleanconsumed()Whether this buffer is fully consumed (all available bytes were read).default BufferDatacopy()Copy the underlying data into a new buffer that does not retain any reference.Debug this buffer as binary string.default StringDebug the full buffer.debugDataHex(boolean fullBuffer) Debug this buffer as hex string.default voidDo an operation on each byte in this buffer.intget(int index) Get byte at index (current read position + index).intindexOf(byte aByte) Find index of the provided byte from the current position.default intlastIndexOf(byte aByte) Find last index of the provided byte from the current position.intlastIndexOf(byte aByte, int length) Find last index of the provided byte from the current position.intread()Read a single byte from this buffer.default intread(byte[] bytes) Read bytes from this buffer into the provided buffer.intread(byte[] bytes, int position, int length) Read bytes from this buffer into the provided buffer.default byte[]Read the content of this data as bytes.intreadFrom(InputStream in) Read bytes from the input stream.intreadFrom(ByteBuffer buf) Read bytes from the provided buffer.default intreadHpackInt(int originalValue, int bitsOfPrefix) HPack integer value (may be 1 or more bytes).default intRead 16-bit integer.default intRead a 24-bit integer.default intRead 32-bit integer.default longreadLong()Read 64-bit long.default StringreadString(int length) Read a UTF-8 string from this buffer.readString(int length, Charset charset) Read a string from this buffer.default longRead 32-bit unsigned integer (must be represented as a long, as Java integer is 32-bit signed).reset()Reset read and write position of this buffer.rewind()Set read position to 0, so others may read the same data from the start.voidskip(int length) Skip the next n bytes (move read position).trim(int x) Trim the last x bytes from a buffer (remove them).default voidwrite(byte[] bytes) Write the byte array to this buffer.voidwrite(byte[] bytes, int offset, int length) Write the byte array to this buffer.write(int value) Write a byte.default voidwrite(BufferData toWrite) Write the provided buffer to this buffer.voidwrite(BufferData toWrite, int length) Write n bytes from the provided buffer to this buffer.default voidwriteAscii(String text) Write ascii string to this buffer.default BufferDatawriteHpackInt(int value, int prefixedInt, int bitPrefix) Write hpack integer to this buffer.default BufferDatawriteInt16(int number) Write 16-bit integer.default BufferDatawriteInt24(int number) Write 24-bit integer.default BufferDatawriteInt32(int number) Write 32-bit integer.default BufferDatawriteInt64(long number) Write 64-bit integer.default BufferDatawriteInt8(int number) Write 8-bit integer.voidwriteTo(OutputStream out) Write all available bytes of this buffer to the output stream.intwriteTo(ByteBuffer writeBuffer, int length) Write n bytes from this buffer to the provided buffer.default BufferDatawriteUnsignedInt32(long number) Write 32-bit unsigned integer.
-
Method Details
-
add
Add this buffer to the list of buffers already in this composite buffer.- Parameters:
bufferData- buffer data to add to this composite buffer- Returns:
- this instance
-