Class AbstractDerivedByteBuf
java.lang.Object
io.netty.buffer.ByteBuf
io.netty.buffer.AbstractByteBuf
io.netty.buffer.AbstractDerivedByteBuf
- All Implemented Interfaces:
ByteBufConvertible, ReferenceCounted, Comparable<ByteBuf>
- Direct Known Subclasses:
DuplicatedByteBuf, ReadOnlyByteBuf, SlicedByteBuf
Deprecated.
Do not use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninternalNioBuffer(int index, int length) Deprecated.Internal use only: Exposes the internal NIO buffer.booleanDeprecated.Returnstrueif thisByteBufimplementation is backed by a single memory region.booleanDeprecated.Returnstrueif and only if this buffer is read-only.nioBuffer(int index, int length) Deprecated.Exposes this buffer's sub-region as an NIOByteBuffer.final intrefCnt()Deprecated.Returns the reference count of this object.final booleanrelease()Deprecated.Decreases the reference count by1and deallocates this object if the reference count reaches at0.final booleanrelease(int decrement) Deprecated.Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.final ByteBufretain()Deprecated.Increases the reference count by1.final ByteBufretain(int increment) Deprecated.Increases the reference count by the specifiedincrement.final ByteBuftouch()Deprecated.Records the current access location of this object for debugging purposes.final ByteBufDeprecated.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class AbstractByteBuf
_getByte, _getInt, _getIntLE, _getLong, _getLongLE, _getShort, _getShortLE, _getUnsignedMedium, _getUnsignedMediumLE, _setByte, _setInt, _setIntLE, _setLong, _setLongLE, _setMedium, _setMediumLE, _setShort, _setShortLE, adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readString, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, setZero, skipBytes, slice, slice, toString, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE, writeZeroModifier and TypeMethodDescriptionprotected abstract byte_getByte(int index) protected abstract int_getInt(int index) protected abstract int_getIntLE(int index) protected abstract long_getLong(int index) protected abstract long_getLongLE(int index) protected abstract short_getShort(int index) protected abstract short_getShortLE(int index) protected abstract int_getUnsignedMedium(int index) protected abstract int_getUnsignedMediumLE(int index) protected abstract void_setByte(int index, int value) protected abstract void_setInt(int index, int value) protected abstract void_setIntLE(int index, int value) protected abstract void_setLong(int index, long value) protected abstract void_setLongLE(int index, long value) protected abstract void_setMedium(int index, int value) protected abstract void_setMediumLE(int index, int value) protected abstract void_setShort(int index, int value) protected abstract void_setShortLE(int index, int value) protected final voidadjustMarkers(int decrement) Returns a read-only version of this buffer.intbytesBefore(byte value) Locates the first occurrence of the specifiedvaluein this buffer.intbytesBefore(int length, byte value) Locates the first occurrence of the specifiedvaluein this buffer.intbytesBefore(int index, int length, byte value) Locates the first occurrence of the specifiedvaluein this buffer.protected final voidcheckDstIndex(int length, int dstIndex, int dstCapacity) protected final voidcheckDstIndex(int index, int length, int dstIndex, int dstCapacity) protected final voidcheckIndex(int index) protected final voidcheckIndex(int index, int fieldLength) protected final voidcheckNewCapacity(int newCapacity) protected final voidcheckReadableBytes(int minimumReadableBytes) Throws anIndexOutOfBoundsExceptionif the current readable bytes of this buffer is less than the specified value.protected final voidcheckSrcIndex(int index, int length, int srcIndex, int srcCapacity) clear()Sets thereaderIndexandwriterIndexof this buffer to0.intCompares the content of the specified buffer to the content of this buffer.copy()Returns a copy of this buffer's readable bytes.Discards the bytes between the 0th index andreaderIndex.Similar toByteBuf.discardReadBytes()except that this method might discard some, all, or none of read bytes depending on its internal implementation to reduce overall memory bandwidth consumption at the cost of potentially additional memory consumption.Returns a buffer which shares the whole region of this buffer.protected final voidShould be called by every method that tries to access the buffers content to check if the buffer was released before.ensureWritable(int minWritableBytes) Expands the bufferByteBuf.capacity()to make sure the number of writable bytes is equal to or greater than the specified value.intensureWritable(int minWritableBytes, boolean force) Expands the bufferByteBuf.capacity()to make sure the number of writable bytes is equal to or greater than the specified value.booleanDetermines if the content of the specified buffer is identical to the content of this array.intforEachByte(int index, int length, ByteProcessor processor) Iterates over the specified area of this buffer with the specifiedprocessorin ascending order.intforEachByte(ByteProcessor processor) Iterates over the readable bytes of this buffer with the specifiedprocessorin ascending order.intforEachByteDesc(int index, int length, ByteProcessor processor) Iterates over the specified area of this buffer with the specifiedprocessorin descending order.intforEachByteDesc(ByteProcessor processor) Iterates over the readable bytes of this buffer with the specifiedprocessorin descending order.booleangetBoolean(int index) Gets a boolean at the specified absolute (@code index) in this buffer.bytegetByte(int index) Gets a byte at the specified absoluteindexin this buffer.getBytes(int index, byte[] dst) Transfers this buffer's data to the specified destination starting at the specified absoluteindex.Transfers this buffer's data to the specified destination starting at the specified absoluteindexuntil the destination becomes non-writable.Transfers this buffer's data to the specified destination starting at the specified absoluteindex.chargetChar(int index) Gets a 2-byte UTF-16 character at the specified absoluteindexin this buffer.getCharSequence(int index, int length, Charset charset) Gets aCharSequencewith the given length at the given index.doublegetDouble(int index) Gets a 64-bit floating point number at the specified absoluteindexin this buffer.floatgetFloat(int index) Gets a 32-bit floating point number at the specified absoluteindexin this buffer.intgetInt(int index) Gets a 32-bit integer at the specified absoluteindexin this buffer.intgetIntLE(int index) Gets a 32-bit integer at the specified absoluteindexin this buffer with Little Endian Byte Order.longgetLong(int index) Gets a 64-bit long integer at the specified absoluteindexin this buffer.longgetLongLE(int index) Gets a 64-bit long integer at the specified absoluteindexin this buffer in Little Endian Byte Order.intgetMedium(int index) Gets a 24-bit medium integer at the specified absoluteindexin this buffer.intgetMediumLE(int index) Gets a 24-bit medium integer at the specified absoluteindexin this buffer in the Little Endian Byte Order.shortgetShort(int index) Gets a 16-bit short integer at the specified absoluteindexin this buffer.shortgetShortLE(int index) Gets a 16-bit short integer at the specified absoluteindexin this buffer in Little Endian Byte Order.shortgetUnsignedByte(int index) Gets an unsigned byte at the specified absoluteindexin this buffer.longgetUnsignedInt(int index) Gets an unsigned 32-bit integer at the specified absoluteindexin this buffer.longgetUnsignedIntLE(int index) Gets an unsigned 32-bit integer at the specified absoluteindexin this buffer in Little Endian Byte Order.intgetUnsignedMedium(int index) Gets an unsigned 24-bit medium integer at the specified absoluteindexin this buffer.intgetUnsignedMediumLE(int index) Gets an unsigned 24-bit medium integer at the specified absoluteindexin this buffer in Little Endian Byte Order.intgetUnsignedShort(int index) Gets an unsigned 16-bit short integer at the specified absoluteindexin this buffer.intgetUnsignedShortLE(int index) Gets an unsigned 16-bit short integer at the specified absoluteindexin this buffer in Little Endian Byte Order.inthashCode()Returns a hash code which was calculated from the content of this buffer.intindexOf(int fromIndex, int toIndex, byte value) Locates the first occurrence of the specifiedvaluein this buffer.booleanReturnstrueif and only if(this.writerIndex - this.readerIndex)is greater than0.booleanisReadable(int numBytes) Returnstrueif and only if this buffer contains equal to or more than the specified number of elements.booleanReturnstrueif and only if(this.capacity - this.writerIndex)is greater than0.booleanisWritable(int numBytes) Returnstrueif and only if this buffer has enough room to allow writing the specified number of elements.Marks the currentreaderIndexin this buffer.Marks the currentwriterIndexin this buffer.intReturns the maximum allowed capacity of this buffer.protected final voidmaxCapacity(int maxCapacity) intReturns the maximum possible number of writable bytes, which is equal to(this.maxCapacity - this.writerIndex).protected SwappedByteBufCreates a newSwappedByteBuffor thisByteBufinstance.Exposes this buffer's readable bytes as an NIOByteBuffer.Exposes this buffer's readable bytes as an NIOByteBuffer's.Returns a buffer with the specifiedendiannesswhich shares the whole region, indexes, and marks of this buffer.intReturns the number of readable bytes which is equal to(this.writerIndex - this.readerIndex).booleanGets a boolean at the currentreaderIndexand increases thereaderIndexby1in this buffer.bytereadByte()Gets a byte at the currentreaderIndexand increases thereaderIndexby1in this buffer.readBytes(byte[] dst) Transfers this buffer's data to the specified destination starting at the currentreaderIndexand increases thereaderIndexby the number of the transferred bytes (=dst.length).readBytes(byte[] dst, int dstIndex, int length) Transfers this buffer's data to the specified destination starting at the currentreaderIndexand increases thereaderIndexby the number of the transferred bytes (=length).readBytes(int length) Transfers this buffer's data to a newly created buffer starting at the currentreaderIndexand increases thereaderIndexby the number of the transferred bytes (=length).Transfers this buffer's data to the specified destination starting at the currentreaderIndexuntil the destination becomes non-writable, and increases thereaderIndexby the number of the transferred bytes.Transfers this buffer's data to the specified destination starting at the currentreaderIndexand increases thereaderIndexby the number of the transferred bytes (=length).Transfers this buffer's data to the specified destination starting at the currentreaderIndexand increases thereaderIndexby the number of the transferred bytes (=length).readBytes(OutputStream out, int length) Transfers this buffer's data to the specified stream starting at the currentreaderIndex.readBytes(ByteBuffer dst) Transfers this buffer's data to the specified destination starting at the currentreaderIndexuntil the destination's position reaches its limit, and increases thereaderIndexby the number of the transferred bytes.intreadBytes(FileChannel out, long position, int length) Transfers this buffer's data starting at the currentreaderIndexto the specified channel starting at the given file position.intreadBytes(GatheringByteChannel out, int length) Transfers this buffer's data to the specified stream starting at the currentreaderIndex.charreadChar()Gets a 2-byte UTF-16 character at the currentreaderIndexand increases thereaderIndexby2in this buffer.readCharSequence(int length, Charset charset) Gets aCharSequencewith the given length at the currentreaderIndexand increases thereaderIndexby the given length.doubleGets a 64-bit floating point number at the currentreaderIndexand increases thereaderIndexby8in this buffer.intReturns thereaderIndexof this buffer.readerIndex(int readerIndex) Sets thereaderIndexof this buffer.floatGets a 32-bit floating point number at the currentreaderIndexand increases thereaderIndexby4in this buffer.intreadInt()Gets a 32-bit integer at the currentreaderIndexand increases thereaderIndexby4in this buffer.intGets a 32-bit integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby4in this buffer.longreadLong()Gets a 64-bit integer at the currentreaderIndexand increases thereaderIndexby8in this buffer.longGets a 64-bit integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby8in this buffer.intGets a 24-bit medium integer at the currentreaderIndexand increases thereaderIndexby3in this buffer.intGets a 24-bit medium integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby3in this buffer.readRetainedSlice(int length) Returns a new retained slice of this buffer's sub-region starting at the currentreaderIndexand increases thereaderIndexby the size of the new slice (=length).shortGets a 16-bit short integer at the currentreaderIndexand increases thereaderIndexby2in this buffer.shortGets a 16-bit short integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby2in this buffer.readSlice(int length) Returns a new slice of this buffer's sub-region starting at the currentreaderIndexand increases thereaderIndexby the size of the new slice (=length).readString(int length, Charset charset) Gets aStringwith the given length at the currentreaderIndexand increases thereaderIndexby the given length.shortGets an unsigned byte at the currentreaderIndexand increases thereaderIndexby1in this buffer.longGets an unsigned 32-bit integer at the currentreaderIndexand increases thereaderIndexby4in this buffer.longGets an unsigned 32-bit integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby4in this buffer.intGets an unsigned 24-bit medium integer at the currentreaderIndexand increases thereaderIndexby3in this buffer.intGets an unsigned 24-bit medium integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby3in this buffer.intGets an unsigned 16-bit short integer at the currentreaderIndexand increases thereaderIndexby2in this buffer.intGets an unsigned 16-bit short integer at the currentreaderIndexin the Little Endian Byte Order and increases thereaderIndexby2in this buffer.Repositions the currentreaderIndexto the markedreaderIndexin this buffer.Repositions the currentwriterIndexto the markedwriterIndexin this buffer.Returns a retained buffer which shares the whole region of this buffer.Returns a retained slice of this buffer's readable bytes.retainedSlice(int index, int length) Returns a retained slice of this buffer's sub-region.setBoolean(int index, boolean value) Sets the specified boolean at the specified absoluteindexin this buffer.setByte(int index, int value) Sets the specified byte at the specified absoluteindexin this buffer.setBytes(int index, byte[] src) Transfers the specified source array's data to this buffer starting at the specified absoluteindex.Transfers the specified source buffer's data to this buffer starting at the specified absoluteindexuntil the source buffer becomes unreadable.Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex.setChar(int index, int value) Sets the specified 2-byte UTF-16 character at the specified absoluteindexin this buffer.intsetCharSequence(int index, CharSequence sequence, Charset charset) Writes the specifiedCharSequenceat the givenindex.setDouble(int index, double value) Sets the specified 64-bit floating-point number at the specified absoluteindexin this buffer.setFloat(int index, float value) Sets the specified 32-bit floating-point number at the specified absoluteindexin this buffer.setIndex(int readerIndex, int writerIndex) Sets thereaderIndexandwriterIndexof this buffer in one shot.setInt(int index, int value) Sets the specified 32-bit integer at the specified absoluteindexin this buffer.setIntLE(int index, int value) Sets the specified 32-bit integer at the specified absoluteindexin this buffer with Little Endian byte order .setLong(int index, long value) Sets the specified 64-bit long integer at the specified absoluteindexin this buffer.setLongLE(int index, long value) Sets the specified 64-bit long integer at the specified absoluteindexin this buffer in Little Endian Byte Order.setMedium(int index, int value) Sets the specified 24-bit medium integer at the specified absoluteindexin this buffer.setMediumLE(int index, int value) Sets the specified 24-bit medium integer at the specified absoluteindexin this buffer in the Little Endian Byte Order.setShort(int index, int value) Sets the specified 16-bit short integer at the specified absoluteindexin this buffer.setShortLE(int index, int value) Sets the specified 16-bit short integer at the specified absoluteindexin this buffer with the Little Endian Byte Order.setZero(int index, int length) Fills this buffer with NUL (0x00) starting at the specified absoluteindex.skipBytes(int length) Increases the currentreaderIndexby the specifiedlengthin this buffer.slice()Returns a slice of this buffer's readable bytes.slice(int index, int length) Returns a slice of this buffer's sub-region.toString()Returns the string representation of this buffer.Decodes this buffer's sub-region into a string with the specified character set.Decodes this buffer's readable bytes into a string with the specified character set name.protected final voidtrimIndicesToCapacity(int newCapacity) intReturns the number of writable bytes which is equal to(this.capacity - this.writerIndex).writeBoolean(boolean value) Sets the specified boolean at the currentwriterIndexand increases thewriterIndexby1in this buffer.writeByte(int value) Sets the specified byte at the currentwriterIndexand increases thewriterIndexby1in this buffer.writeBytes(byte[] src) Transfers the specified source array's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=src.length).writeBytes(byte[] src, int srcIndex, int length) Transfers the specified source array's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length).writeBytes(ByteBuf src) Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexuntil the source buffer becomes unreadable, and increases thewriterIndexby the number of the transferred bytes.writeBytes(ByteBuf src, int length) Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length).writeBytes(ByteBuf src, int srcIndex, int length) Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length).intwriteBytes(InputStream in, int length) Transfers the content of the specified stream to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes.writeBytes(ByteBuffer src) Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexuntil the source buffer's position reaches its limit, and increases thewriterIndexby the number of the transferred bytes.intwriteBytes(FileChannel in, long position, int length) Transfers the content of the specified channel starting at the given file position to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes.intwriteBytes(ScatteringByteChannel in, int length) Transfers the content of the specified channel to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes.writeChar(int value) Sets the specified 2-byte UTF-16 character at the currentwriterIndexand increases thewriterIndexby2in this buffer.intwriteCharSequence(CharSequence sequence, Charset charset) Writes the specifiedCharSequenceat the currentwriterIndexand increases thewriterIndexby the written bytes.writeDouble(double value) Sets the specified 64-bit floating point number at the currentwriterIndexand increases thewriterIndexby8in this buffer.writeFloat(float value) Sets the specified 32-bit floating point number at the currentwriterIndexand increases thewriterIndexby4in this buffer.writeInt(int value) Sets the specified 32-bit integer at the currentwriterIndexand increases thewriterIndexby4in this buffer.writeIntLE(int value) Sets the specified 32-bit integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby4in this buffer.writeLong(long value) Sets the specified 64-bit long integer at the currentwriterIndexand increases thewriterIndexby8in this buffer.writeLongLE(long value) Sets the specified 64-bit long integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby8in this buffer.writeMedium(int value) Sets the specified 24-bit medium integer at the currentwriterIndexand increases thewriterIndexby3in this buffer.writeMediumLE(int value) Sets the specified 24-bit medium integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby3in this buffer.intReturns thewriterIndexof this buffer.writerIndex(int writerIndex) Sets thewriterIndexof this buffer.writeShort(int value) Sets the specified 16-bit short integer at the currentwriterIndexand increases thewriterIndexby2in this buffer.writeShortLE(int value) Sets the specified 16-bit short integer in the Little Endian Byte Order at the currentwriterIndexand increases thewriterIndexby2in this buffer.writeZero(int length) Fills this buffer with NUL (0x00) starting at the currentwriterIndexand increases thewriterIndexby the specifiedlength.Methods inherited from class ByteBuf
alloc, array, arrayOffset, asByteBuf, capacity, capacity, copy, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getDoubleLE, getFloatLE, hasArray, hasMemoryAddress, isDirect, maxFastWritableBytes, memoryAddress, nioBufferCount, nioBuffers, order, readDoubleLE, readFloatLE, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setDoubleLE, setFloatLE, unwrap, writeDoubleLE, writeFloatLEModifier and TypeMethodDescriptionabstract ByteBufAllocatoralloc()Returns theByteBufAllocatorwhich created this buffer.abstract byte[]array()Returns the backing byte array of this buffer.abstract intReturns the offset of the first byte within the backing byte array of this buffer.AByteBufcan turn into itself.abstract intcapacity()Returns the number of bytes (octets) this buffer can contain.abstract ByteBufcapacity(int newCapacity) Adjusts the capacity of this buffer.abstract ByteBufcopy(int index, int length) Returns a copy of this buffer's sub-region.abstract ByteBufgetBytes(int index, byte[] dst, int dstIndex, int length) Transfers this buffer's data to the specified destination starting at the specified absoluteindex.abstract ByteBufTransfers this buffer's data to the specified destination starting at the specified absoluteindex.abstract ByteBufgetBytes(int index, OutputStream out, int length) Transfers this buffer's data to the specified stream starting at the specified absoluteindex.abstract ByteBufgetBytes(int index, ByteBuffer dst) Transfers this buffer's data to the specified destination starting at the specified absoluteindexuntil the destination's position reaches its limit.abstract intgetBytes(int index, FileChannel out, long position, int length) Transfers this buffer's data starting at the specified absoluteindexto the specified channel starting at the given file position.abstract intgetBytes(int index, GatheringByteChannel out, int length) Transfers this buffer's data to the specified channel starting at the specified absoluteindex.doublegetDoubleLE(int index) Gets a 64-bit floating point number at the specified absoluteindexin this buffer in Little Endian Byte Order.floatgetFloatLE(int index) Gets a 32-bit floating point number at the specified absoluteindexin this buffer in Little Endian Byte Order.abstract booleanhasArray()Returnstrueif and only if this buffer has a backing byte array.abstract booleanReturnstrueif and only if this buffer has a reference to the low-level memory address that points to the backing data.abstract booleanisDirect()Returnstrueif and only if this buffer is backed by an NIO direct buffer.intReturns the maximum number of bytes which can be written for certain without involving an internal reallocation or data-copy.abstract longReturns the low-level memory address that point to the first byte of ths backing data.abstract intReturns the maximum number of NIOByteBuffers that consist this buffer.abstract ByteBuffer[]nioBuffers(int index, int length) Exposes this buffer's bytes as an NIOByteBuffer's for the specified index and length The returned buffer either share or contains the copied content of this buffer, while changing the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer.abstract ByteOrderorder()Deprecated.use the Little Endian accessors, e.g.doubleGets a 64-bit floating point number at the currentreaderIndexin Little Endian Byte Order and increases thereaderIndexby8in this buffer.floatGets a 32-bit floating point number at the currentreaderIndexin Little Endian Byte Order and increases thereaderIndexby4in this buffer.abstract ByteBufsetBytes(int index, byte[] src, int srcIndex, int length) Transfers the specified source array's data to this buffer starting at the specified absoluteindex.abstract ByteBufTransfers the specified source buffer's data to this buffer starting at the specified absoluteindex.abstract intsetBytes(int index, InputStream in, int length) Transfers the content of the specified source stream to this buffer starting at the specified absoluteindex.abstract ByteBufsetBytes(int index, ByteBuffer src) Transfers the specified source buffer's data to this buffer starting at the specified absoluteindexuntil the source buffer's position reaches its limit.abstract intsetBytes(int index, FileChannel in, long position, int length) Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absoluteindex.abstract intsetBytes(int index, ScatteringByteChannel in, int length) Transfers the content of the specified source channel to this buffer starting at the specified absoluteindex.setDoubleLE(int index, double value) Sets the specified 64-bit floating-point number at the specified absoluteindexin this buffer in Little Endian Byte Order.setFloatLE(int index, float value) Sets the specified 32-bit floating-point number at the specified absoluteindexin this buffer in Little Endian Byte Order.abstract ByteBufunwrap()Return the underlying buffer instance if this buffer is a wrapper of another buffer.writeDoubleLE(double value) Sets the specified 64-bit floating point number at the currentwriterIndexin Little Endian Byte Order and increases thewriterIndexby8in this buffer.writeFloatLE(float value) Sets the specified 32-bit floating point number at the currentwriterIndexin Little Endian Byte Order and increases thewriterIndexby4in this buffer.
-
Constructor Details
-
AbstractDerivedByteBuf
protected AbstractDerivedByteBuf(int maxCapacity) Deprecated.
-
-
Method Details
-
refCnt
public final int refCnt()Deprecated.Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated. -
retain
Deprecated.Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceReferenceCounted- Specified by:
retainin classByteBuf
-
retain
Deprecated.Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceReferenceCounted- Specified by:
retainin classByteBuf
-
touch
Deprecated.Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceReferenceCounted- Specified by:
touchin classByteBuf
-
touch
Deprecated.Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceReferenceCounted- Specified by:
touchin classByteBuf
-
release
public final boolean release()Deprecated.Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public final boolean release(int decrement) Deprecated.Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
isReadOnly
public boolean isReadOnly()Deprecated.Description copied from class:ByteBufReturnstrueif and only if this buffer is read-only.- Overrides:
isReadOnlyin classAbstractByteBuf
-
internalNioBuffer
Deprecated.Description copied from class:ByteBufInternal use only: Exposes the internal NIO buffer.- Specified by:
internalNioBufferin classByteBuf
-
nioBuffer
Deprecated.Description copied from class:ByteBufExposes this buffer's sub-region as an NIOByteBuffer. The returned buffer either share or contains the copied content of this buffer, while changing the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer. Please note that the returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic buffer and it adjusted its capacity. -
isContiguous
public boolean isContiguous()Deprecated.Description copied from class:ByteBufReturnstrueif thisByteBufimplementation is backed by a single memory region. Composite buffer implementations must return false even if they currently hold ≤ 1 components. For buffers that returntrue, it's guaranteed that a successful call toByteBuf.discardReadBytes()will increase the value ofByteBuf.maxFastWritableBytes()by the currentreaderIndex.This method will return
falseby default, and afalsereturn value does not necessarily mean that the implementation is composite or that it is not backed by a single memory region.- Overrides:
isContiguousin classByteBuf
-