Top Fields Constructors Methods
io.netty.buffer

pack-priv final Class PooledSlicedByteBuf

extends AbstractPooledDerivedByteBuf
Class Inheritance
Imports
io.netty.util.ByteProcessor, io.netty.util.internal.ObjectPool, .ObjectPool.Handle, .ObjectPool.ObjectCreator, java.io.IOException, .InputStream, .OutputStream, java.nio.ByteBuffer, java.nio.channels.FileChannel, .GatheringByteChannel, .ScatteringByteChannel

Field Summary

Modifier and TypeField and Description
pack-priv int
private static final ObjectPool<PooledSlicedByteBuf>

Constructor Summary

AccessConstructor and Description
private

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 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 ByteBuf
duplicate()

Overrides io.netty.buffer.AbstractByteBuf.duplicate.

Returns a buffer which shares the whole region of this buffer.
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.
private int
idx(int index)

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.
pack-priv static PooledSlicedByteBuf
newInstance(AbstractByteBuf unwrapped, ByteBuf wrapped, int index, int length)

private static PooledSlicedByteBuf
newInstance0(AbstractByteBuf unwrapped, ByteBuf wrapped, int adjustment, int length)

public ByteBuffer
nioBuffer(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffer.

Exposes this buffer's sub-region as an NIO ByteBuffer.
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 ByteBuf
retainedDuplicate()

Overrides io.netty.buffer.AbstractByteBuf.retainedDuplicate.

Returns a retained buffer which shares the whole region of this buffer.
public ByteBuf
retainedSlice(int index, int length)

Overrides io.netty.buffer.AbstractByteBuf.retainedSlice.

Returns a retained slice of this buffer's sub-region.
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.AbstractPooledDerivedByteBuf.slice.

Returns a slice of this buffer's sub-region.
Inherited from io.netty.buffer.AbstractPooledDerivedByteBuf:
allocarraydeallocateduplicate0hasArrayhasMemoryAddressinitinternalNioBufferisContiguousisDirectisReadOnlynioBufferCountorderparentretainedSliceunwrap

Field Detail

adjustmentback to summary
pack-priv int adjustment
RECYCLERback to summary
private static final ObjectPool<PooledSlicedByteBuf> RECYCLER

Constructor Detail

PooledSlicedByteBufback to summary
private PooledSlicedByteBuf(ObjectPool.Handle<PooledSlicedByteBuf> handle)

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
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
duplicateback to summary
public ByteBuf duplicate()

Overrides io.netty.buffer.AbstractByteBuf.duplicate.

Doc from io.netty.buffer.ByteBuf.duplicate.

Returns a buffer which shares the whole region of this buffer. 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.

The reader and writer marks will not be duplicated. Also be aware that this method will NOT call retain() and so the reference count will NOT be increased.

Returns:ByteBuf

A buffer whose readable content is equivalent to the buffer returned by slice(). However this buffer will share the capacity of the underlying buffer, and therefore allows access to all of the underlying content if necessary.

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
idxback to summary
private int idx(int index)
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
newInstanceback to summary
pack-priv static PooledSlicedByteBuf newInstance(AbstractByteBuf unwrapped, ByteBuf wrapped, int index, int length)
newInstance0back to summary
private static PooledSlicedByteBuf newInstance0(AbstractByteBuf unwrapped, ByteBuf wrapped, int adjustment, int length)
nioBufferback to summary
public ByteBuffer nioBuffer(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffer.

Doc from io.netty.buffer.ByteBuf.nioBuffer.

Exposes this buffer's sub-region as an NIO ByteBuffer. 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
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
retainedDuplicateback to summary
public ByteBuf retainedDuplicate()

Overrides io.netty.buffer.AbstractByteBuf.retainedDuplicate.

Doc from io.netty.buffer.ByteBuf.retainedDuplicate.

Returns a retained buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(0, buf.capacity()). This method does not modify readerIndex or writerIndex of this buffer.

Note that this method returns a retained buffer unlike slice(int, int). This method behaves similarly to duplicate().retain() except that this method may return a buffer implementation that produces less garbage.

Annotations
@Override
retainedSliceback to summary
public ByteBuf retainedSlice(int index, int length)

Overrides io.netty.buffer.AbstractByteBuf.retainedSlice.

Doc from io.netty.buffer.ByteBuf.retainedSlice.

Returns a retained 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.

Note that this method returns a retained buffer unlike slice(int, int). This method behaves similarly to slice(...).retain() except that this method may return a buffer implementation that produces less garbage.

Annotations
@Override
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.AbstractPooledDerivedByteBuf.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