Top Description Fields Constructors Methods
io.netty.buffer

public Class DuplicatedByteBuf

extends AbstractDerivedByteBuf
Class Inheritance
Known Direct Subclasses
io.netty.buffer.UnpooledDuplicatedByteBuf
Annotations
@Deprecated
Imports
io.netty.util.ByteProcessor, java.io.IOException, .InputStream, .OutputStream, java.nio.ByteBuffer, .ByteOrder, java.nio.channels.FileChannel, .GatheringByteChannel, .ScatteringByteChannel

Deprecated

Do not use.

A derived buffer which simply forwards all data access requests to its parent. It is recommended to use ByteBuf#duplicate() instead of calling the constructor explicitly.

Field Summary

Modifier and TypeField and Description
private final ByteBuf

Constructor Summary

AccessConstructor and Description
public
pack-priv
DuplicatedByteBuf(ByteBuf buffer, int readerIndex, int writerIndex)

Method Summary

Modifier and TypeMethod and Description
protected byte
_getByte(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getByte.

protected int
_getInt(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getInt.

protected int
protected long
_getLong(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getLong.

protected long
protected short
protected short
protected int
protected int
protected void
_setByte(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setByte.

protected void
_setInt(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setInt.

protected void
_setIntLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setIntLE.

protected void
_setLong(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLong.

protected void
_setLongLE(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLongLE.

protected void
_setMedium(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMedium.

protected void
_setMediumLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMediumLE.

protected void
_setShort(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShort.

protected void
_setShortLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShortLE.

public ByteBufAllocator
alloc()

Implements abstract io.netty.buffer.ByteBuf.alloc.

Returns the ByteBufAllocator which created this buffer.
public byte[]
array()

Implements abstract io.netty.buffer.ByteBuf.array.

Returns the backing byte array of this buffer.
public int
arrayOffset()

Implements abstract io.netty.buffer.ByteBuf.arrayOffset.

Returns the offset of the first byte within the backing byte array of this buffer.
public int
capacity()

Implements abstract io.netty.buffer.ByteBuf.capacity.

Returns the number of bytes (octets) this buffer can contain.
public ByteBuf
capacity(int newCapacity)

Implements abstract io.netty.buffer.ByteBuf.capacity.

Adjusts the capacity of this buffer.
public ByteBuf
copy(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.copy.

Returns a copy of this buffer's sub-region.
public int
forEachByte(int index, int length, ByteProcessor processor)

Overrides io.netty.buffer.AbstractByteBuf.forEachByte.

Iterates over the specified area of this buffer with the specified processor in ascending order.
public int
forEachByteDesc(int index, int length, ByteProcessor processor)

Overrides io.netty.buffer.AbstractByteBuf.forEachByteDesc.

Iterates over the specified area of this buffer with the specified processor in descending order.
public byte
getByte(int index)

Overrides io.netty.buffer.AbstractByteBuf.getByte.

Gets a byte at the specified absolute index in this buffer.
public ByteBuf
getBytes(int index, ByteBuf dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public ByteBuf
getBytes(int index, byte[] dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public ByteBuf
getBytes(int index, ByteBuffer dst)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit.
public ByteBuf
getBytes(int index, OutputStream out, int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified stream starting at the specified absolute index.
public int
getBytes(int index, GatheringByteChannel out, int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified channel starting at the specified absolute index.
public int
getBytes(int index, FileChannel out, long
the file position at which the transfer is to begin
position
,
int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data starting at the specified absolute index to the specified channel starting at the given file position.
public int
getInt(int index)

Overrides io.netty.buffer.AbstractByteBuf.getInt.

Gets a 32-bit integer at the specified absolute index in this buffer.
public int
getIntLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getIntLE.

Gets a 32-bit integer at the specified absolute index in this buffer with Little Endian Byte Order.
public long
getLong(int index)

Overrides io.netty.buffer.AbstractByteBuf.getLong.

Gets a 64-bit long integer at the specified absolute index in this buffer.
public long
getLongLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getLongLE.

Gets a 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order.
public short
getShort(int index)

Overrides io.netty.buffer.AbstractByteBuf.getShort.

Gets a 16-bit short integer at the specified absolute index in this buffer.
public short
getShortLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getShortLE.

Gets a 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order.
public int
getUnsignedMedium(int index)

Overrides io.netty.buffer.AbstractByteBuf.getUnsignedMedium.

Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer.
public int
getUnsignedMediumLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getUnsignedMediumLE.

Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer in Little Endian Byte Order.
public boolean
hasArray()

Implements abstract io.netty.buffer.ByteBuf.hasArray.

Returns true if and only if this buffer has a backing byte array.
public boolean
hasMemoryAddress()

Implements abstract io.netty.buffer.ByteBuf.hasMemoryAddress.

Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.
public boolean
isDirect()

Implements abstract io.netty.buffer.ByteBuf.isDirect.

Returns true if and only if this buffer is backed by an NIO direct buffer.
public long
memoryAddress()

Implements abstract io.netty.buffer.ByteBuf.memoryAddress.

Returns the low-level memory address that point to the first byte of ths backing data.
public int
nioBufferCount()

Implements abstract io.netty.buffer.ByteBuf.nioBufferCount.

Returns the maximum number of NIO ByteBuffers that consist this buffer.
public ByteBuffer[]
nioBuffers(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffers.

Exposes this buffer's bytes as an NIO ByteBuffer'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.
public ByteOrder
order()

Implements abstract io.netty.buffer.ByteBuf.order.

Deprecated
Returns the endianness of this buffer.
public ByteBuf
setByte(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setByte.

Sets the specified byte at the specified absolute index in this buffer.
public ByteBuf
setBytes(int index, byte[] src, int srcIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source array's data to this buffer starting at the specified absolute index.
public ByteBuf
setBytes(int index, ByteBuf src, int
the first index of the source
srcIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
public ByteBuf
setBytes(int index, ByteBuffer src)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit.
public int
setBytes(int index, InputStream in, int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source stream to this buffer starting at the specified absolute index.
public int
setBytes(int index, ScatteringByteChannel in, int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel to this buffer starting at the specified absolute index.
public int
setBytes(int index, FileChannel in, long
the file position at which the transfer is to begin
position
,
int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absolute index.
public ByteBuf
setInt(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setInt.

Sets the specified 32-bit integer at the specified absolute index in this buffer.
public ByteBuf
setIntLE(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setIntLE.

Sets the specified 32-bit integer at the specified absolute index in this buffer with Little Endian byte order .
public ByteBuf
setLong(int index, long value)

Overrides io.netty.buffer.AbstractByteBuf.setLong.

Sets the specified 64-bit long integer at the specified absolute index in this buffer.
public ByteBuf
setLongLE(int index, long value)

Overrides io.netty.buffer.AbstractByteBuf.setLongLE.

Sets the specified 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order.
public ByteBuf
setMedium(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setMedium.

Sets the specified 24-bit medium integer at the specified absolute index in this buffer.
public ByteBuf
setMediumLE(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setMediumLE.

Sets the specified 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order.
public ByteBuf
setShort(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setShort.

Sets the specified 16-bit short integer at the specified absolute index in this buffer.
public ByteBuf
setShortLE(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setShortLE.

Sets the specified 16-bit short integer at the specified absolute index in this buffer with the Little Endian Byte Order.
public ByteBuf
slice(int index, int length)

Overrides io.netty.buffer.AbstractByteBuf.slice.

Returns a slice of this buffer's sub-region.
public ByteBuf
unwrap()

Implements abstract io.netty.buffer.ByteBuf.unwrap.

Return the underlying buffer instance if this buffer is a wrapper of another buffer.
Inherited from io.netty.buffer.AbstractDerivedByteBuf:
internalNioBufferisAccessibleisAccessible0isContiguousisReadOnlynioBufferrefCntrefCnt0releasereleaserelease0release0retainretainretain0retain0touchtouchtouch0touch0

Field Detail

bufferback to summary
private final ByteBuf buffer

Constructor Detail

DuplicatedByteBufback to summary
public DuplicatedByteBuf(ByteBuf buffer)
DuplicatedByteBufback to summary
pack-priv DuplicatedByteBuf(ByteBuf buffer, int readerIndex, int writerIndex)

Method Detail

_getByteback to summary
protected byte _getByte(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getByte.

Annotations
@Override
_getIntback to summary
protected int _getInt(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getInt.

Annotations
@Override
_getIntLEback to summary
protected int _getIntLE(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getIntLE.

Annotations
@Override
_getLongback to summary
protected long _getLong(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getLong.

Annotations
@Override
_getLongLEback to summary
protected long _getLongLE(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getLongLE.

Annotations
@Override
_getShortback to summary
protected short _getShort(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getShort.

Annotations
@Override
_getShortLEback to summary
protected short _getShortLE(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getShortLE.

Annotations
@Override
_getUnsignedMediumback to summary
protected int _getUnsignedMedium(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getUnsignedMedium.

Annotations
@Override
_getUnsignedMediumLEback to summary
protected int _getUnsignedMediumLE(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getUnsignedMediumLE.

Annotations
@Override
_setByteback to summary
protected void _setByte(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setByte.

Annotations
@Override
_setIntback to summary
protected void _setInt(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setInt.

Annotations
@Override
_setIntLEback to summary
protected void _setIntLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setIntLE.

Annotations
@Override
_setLongback to summary
protected void _setLong(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLong.

Annotations
@Override
_setLongLEback to summary
protected void _setLongLE(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLongLE.

Annotations
@Override
_setMediumback to summary
protected void _setMedium(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMedium.

Annotations
@Override
_setMediumLEback to summary
protected void _setMediumLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMediumLE.

Annotations
@Override
_setShortback to summary
protected void _setShort(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShort.

Annotations
@Override
_setShortLEback to summary
protected void _setShortLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShortLE.

Annotations
@Override
allocback to summary
public ByteBufAllocator alloc()

Implements abstract io.netty.buffer.ByteBuf.alloc.

Doc from io.netty.buffer.ByteBuf.alloc.

Returns the ByteBufAllocator which created this buffer.

Annotations
@Override
arrayback to summary
public byte[] array()

Implements abstract io.netty.buffer.ByteBuf.array.

Doc from io.netty.buffer.ByteBuf.array.

Returns the backing byte array of this buffer.

Annotations
@Override
arrayOffsetback to summary
public int arrayOffset()

Implements abstract io.netty.buffer.ByteBuf.arrayOffset.

Doc from io.netty.buffer.ByteBuf.arrayOffset.

Returns the offset of the first byte within the backing byte array of this buffer.

Annotations
@Override
capacityback to summary
public int capacity()

Implements abstract io.netty.buffer.ByteBuf.capacity.

Doc from io.netty.buffer.ByteBuf.capacity.

Returns the number of bytes (octets) this buffer can contain.

Annotations
@Override
capacityback to summary
public ByteBuf capacity(int newCapacity)

Implements abstract io.netty.buffer.ByteBuf.capacity.

Doc from io.netty.buffer.ByteBuf.capacity.

Adjusts the capacity of this buffer. If the newCapacity is less than the current capacity, the content of this buffer is truncated. If the newCapacity is greater than the current capacity, the buffer is appended with unspecified data whose length is (newCapacity - currentCapacity).

Annotations
@Override
copyback to summary
public ByteBuf copy(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.copy.

Doc from io.netty.buffer.ByteBuf.copy.

Returns a copy of this buffer's sub-region. Modifying the content of the returned buffer or this buffer does not affect each other at all. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
forEachByteback to summary
public int forEachByte(int index, int length, ByteProcessor processor)

Overrides io.netty.buffer.AbstractByteBuf.forEachByte.

Doc from io.netty.buffer.ByteBuf.forEachByte.

Iterates over the specified area of this buffer with the specified processor in ascending order. (i.e. index, (index + 1), .. (index + length - 1))

Returns:int

-1 if the processor iterated to or beyond the end of the specified area. The last-visited index If the ByteProcessor#process(byte) returned false.

Annotations
@Override
forEachByteDescback to summary
public int forEachByteDesc(int index, int length, ByteProcessor processor)

Overrides io.netty.buffer.AbstractByteBuf.forEachByteDesc.

Doc from io.netty.buffer.ByteBuf.forEachByteDesc.

Iterates over the specified area of this buffer with the specified processor in descending order. (i.e. (index + length - 1), (index + length - 2), ... index)

Returns:int

-1 if the processor iterated to or beyond the beginning of the specified area. The last-visited index If the ByteProcessor#process(byte) returned false.

Annotations
@Override
getByteback to summary
public byte getByte(int index)

Overrides io.netty.buffer.AbstractByteBuf.getByte.

Doc from io.netty.buffer.ByteBuf.getByte.

Gets a byte at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getBytesback to summary
public ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Doc from io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.

Parameters
dstIndex:int

the first index of the destination

length:int

the number of bytes to transfer

Annotations
@Override
getBytesback to summary
public ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Doc from io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Parameters
dstIndex:int

the first index of the destination

length:int

the number of bytes to transfer

Annotations
@Override
getBytesback to summary
public ByteBuf getBytes(int index, ByteBuffer dst)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Doc from io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit. This method does not modify readerIndex or writerIndex of this buffer while the destination's position will be increased.

Annotations
@Override
getBytesback to summary
public ByteBuf getBytes(int index, OutputStream out, int length) throws IOException

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Doc from io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified stream starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Parameters
length:int

the number of bytes to transfer

Annotations
@Override
Exceptions
IOException:
if the specified stream threw an exception during I/O
getBytesback to summary
public int getBytes(int index, GatheringByteChannel out, int length) throws IOException

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Doc from io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified channel starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Parameters
length:int

the maximum number of bytes to transfer

Returns:int

the actual number of bytes written out to the specified channel

Annotations
@Override
Exceptions
IOException:
if the specified channel threw an exception during I/O
getBytesback to summary
public int getBytes(int index, FileChannel out, long position, int length) throws IOException

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Doc from io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data starting at the specified absolute index to the specified channel starting at the given file position. This method does not modify readerIndex or writerIndex of this buffer. This method does not modify the channel's position.

Parameters
position:long

the file position at which the transfer is to begin

length:int

the maximum number of bytes to transfer

Returns:int

the actual number of bytes written out to the specified channel

Annotations
@Override
Exceptions
IOException:
if the specified channel threw an exception during I/O
getIntback to summary
public int getInt(int index)

Overrides io.netty.buffer.AbstractByteBuf.getInt.

Doc from io.netty.buffer.ByteBuf.getInt.

Gets a 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getIntLEback to summary
public int getIntLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getIntLE.

Doc from io.netty.buffer.ByteBuf.getIntLE.

Gets a 32-bit integer at the specified absolute index in this buffer with Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getLongback to summary
public long getLong(int index)

Overrides io.netty.buffer.AbstractByteBuf.getLong.

Doc from io.netty.buffer.ByteBuf.getLong.

Gets a 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getLongLEback to summary
public long getLongLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getLongLE.

Doc from io.netty.buffer.ByteBuf.getLongLE.

Gets a 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getShortback to summary
public short getShort(int index)

Overrides io.netty.buffer.AbstractByteBuf.getShort.

Doc from io.netty.buffer.ByteBuf.getShort.

Gets a 16-bit short integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getShortLEback to summary
public short getShortLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getShortLE.

Doc from io.netty.buffer.ByteBuf.getShortLE.

Gets a 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getUnsignedMediumback to summary
public int getUnsignedMedium(int index)

Overrides io.netty.buffer.AbstractByteBuf.getUnsignedMedium.

Doc from io.netty.buffer.ByteBuf.getUnsignedMedium.

Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
getUnsignedMediumLEback to summary
public int getUnsignedMediumLE(int index)

Overrides io.netty.buffer.AbstractByteBuf.getUnsignedMediumLE.

Doc from io.netty.buffer.ByteBuf.getUnsignedMediumLE.

Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
hasArrayback to summary
public boolean hasArray()

Implements abstract io.netty.buffer.ByteBuf.hasArray.

Doc from io.netty.buffer.ByteBuf.hasArray.

Returns true if and only if this buffer has a backing byte array. If this method returns true, you can safely call array() and arrayOffset().

Annotations
@Override
hasMemoryAddressback to summary
public boolean hasMemoryAddress()

Implements abstract io.netty.buffer.ByteBuf.hasMemoryAddress.

Doc from io.netty.buffer.ByteBuf.hasMemoryAddress.

Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.

Annotations
@Override
isDirectback to summary
public boolean isDirect()

Implements abstract io.netty.buffer.ByteBuf.isDirect.

Doc from io.netty.buffer.ByteBuf.isDirect.

Returns true if and only if this buffer is backed by an NIO direct buffer.

Annotations
@Override
memoryAddressback to summary
public long memoryAddress()

Implements abstract io.netty.buffer.ByteBuf.memoryAddress.

Doc from io.netty.buffer.ByteBuf.memoryAddress.

Returns the low-level memory address that point to the first byte of ths backing data.

Annotations
@Override
nioBufferCountback to summary
public int nioBufferCount()

Implements abstract io.netty.buffer.ByteBuf.nioBufferCount.

Doc from io.netty.buffer.ByteBuf.nioBufferCount.

Returns the maximum number of NIO ByteBuffers that consist this buffer. Note that nioBuffers() or nioBuffers(int, int) might return a less number of ByteBuffers.

Returns:int

-1 if this buffer has no underlying ByteBuffer. the number of the underlying ByteBuffers if this buffer has at least one underlying ByteBuffer. Note that this method does not return 0 to avoid confusion.

Annotations
@Override
nioBuffersback to summary
public ByteBuffer[] nioBuffers(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffers.

Doc from io.netty.buffer.ByteBuf.nioBuffers.

Exposes this buffer's bytes as an NIO ByteBuffer'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. This method does not modify readerIndex or writerIndex of 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.

Annotations
@Override
orderback to summary
public ByteOrder order()

Implements abstract io.netty.buffer.ByteBuf.order.

Doc from io.netty.buffer.ByteBuf.order.

Deprecated

Returns the endianness of this buffer.

Annotations
@Override
@Deprecated
setByteback to summary
public ByteBuf setByte(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setByte.

Doc from io.netty.buffer.ByteBuf.setByte.

Sets the specified byte at the specified absolute index in this buffer. The 24 high-order bits of the specified value are ignored. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setBytesback to summary
public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Doc from io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source array's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setBytesback to summary
public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Doc from io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.

Parameters
srcIndex:int

the first index of the source

length:int

the number of bytes to transfer

Annotations
@Override
setBytesback to summary
public ByteBuf setBytes(int index, ByteBuffer src)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Doc from io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setBytesback to summary
public int setBytes(int index, InputStream in, int length) throws IOException

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Doc from io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source stream to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Parameters
length:int

the number of bytes to transfer

Returns:int

the actual number of bytes read in from the specified channel. -1 if the specified InputStream reached EOF.

Annotations
@Override
Exceptions
IOException:
if the specified stream threw an exception during I/O
setBytesback to summary
public int setBytes(int index, ScatteringByteChannel in, int length) throws IOException

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Doc from io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Parameters
length:int

the maximum number of bytes to transfer

Returns:int

the actual number of bytes read in from the specified channel. -1 if the specified channel is closed or it reached EOF.

Annotations
@Override
Exceptions
IOException:
if the specified channel threw an exception during I/O
setBytesback to summary
public int setBytes(int index, FileChannel in, long position, int length) throws IOException

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Doc from io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer. This method does not modify the channel's position.

Parameters
position:long

the file position at which the transfer is to begin

length:int

the maximum number of bytes to transfer

Returns:int

the actual number of bytes read in from the specified channel. -1 if the specified channel is closed or it reached EOF.

Annotations
@Override
Exceptions
IOException:
if the specified channel threw an exception during I/O
setIntback to summary
public ByteBuf setInt(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setInt.

Doc from io.netty.buffer.ByteBuf.setInt.

Sets the specified 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setIntLEback to summary
public ByteBuf setIntLE(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setIntLE.

Doc from io.netty.buffer.ByteBuf.setIntLE.

Sets the specified 32-bit integer at the specified absolute index in this buffer with Little Endian byte order . This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setLongback to summary
public ByteBuf setLong(int index, long value)

Overrides io.netty.buffer.AbstractByteBuf.setLong.

Doc from io.netty.buffer.ByteBuf.setLong.

Sets the specified 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setLongLEback to summary
public ByteBuf setLongLE(int index, long value)

Overrides io.netty.buffer.AbstractByteBuf.setLongLE.

Doc from io.netty.buffer.ByteBuf.setLongLE.

Sets the specified 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setMediumback to summary
public ByteBuf setMedium(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setMedium.

Doc from io.netty.buffer.ByteBuf.setMedium.

Sets the specified 24-bit medium integer at the specified absolute index in this buffer. Please note that the most significant byte is ignored in the specified value. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setMediumLEback to summary
public ByteBuf setMediumLE(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setMediumLE.

Doc from io.netty.buffer.ByteBuf.setMediumLE.

Sets the specified 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order. Please note that the most significant byte is ignored in the specified value. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setShortback to summary
public ByteBuf setShort(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setShort.

Doc from io.netty.buffer.ByteBuf.setShort.

Sets the specified 16-bit short integer at the specified absolute index in this buffer. The 16 high-order bits of the specified value are ignored. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
setShortLEback to summary
public ByteBuf setShortLE(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setShortLE.

Doc from io.netty.buffer.ByteBuf.setShortLE.

Sets the specified 16-bit short integer at the specified absolute index in this buffer with the Little Endian Byte Order. The 16 high-order bits of the specified value are ignored. This method does not modify readerIndex or writerIndex of this buffer.

Annotations
@Override
sliceback to summary
public ByteBuf slice(int index, int length)

Overrides io.netty.buffer.AbstractByteBuf.slice.

Doc from io.netty.buffer.ByteBuf.slice.

Returns a slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

Also be aware that this method will NOT call retain() and so the reference count will NOT be increased.

Annotations
@Override
unwrapback to summary
public ByteBuf unwrap()

Implements abstract io.netty.buffer.ByteBuf.unwrap.

Doc from io.netty.buffer.ByteBuf.unwrap.

Return the underlying buffer instance if this buffer is a wrapper of another buffer.

Returns:ByteBuf

null if this buffer is not a wrapper

Annotations
@Override