Top Fields Constructors Methods
io.netty.buffer

pack-priv final Class PooledDirectByteBuf

extends PooledByteBuf<ByteBuffer>
Class Inheritance
Imports
io.netty.util.internal.ObjectPool, .ObjectPool.Handle, .ObjectPool.ObjectCreator, java.io.IOException, .InputStream, .OutputStream, java.nio.ByteBuffer

Field Summary

Modifier and TypeField and Description
private static final ObjectPool<PooledDirectByteBuf>
Inherited from io.netty.buffer.PooledByteBuf:
cachechunkhandlelengthmaxLengthmemoryoffsettmpNioBuf

Constructor Summary

AccessConstructor and Description
private
PooledDirectByteBuf(ObjectPool.Handle<PooledDirectByteBuf> recyclerHandle, int maxCapacity)

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 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 ByteBuf
copy(int index, int length)

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

Returns a copy of this buffer's sub-region.
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.
private void
getBytes(int index, OutputStream out, int length, boolean internal)

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.
pack-priv static PooledDirectByteBuf
newInstance(int maxCapacity)

protected ByteBuffer
public ByteBuf
readBytes(byte[] dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
public ByteBuf
readBytes(ByteBuffer dst)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination's position reaches its limit, and increases the readerIndex by the number of the transferred bytes.
public ByteBuf
readBytes(OutputStream out, int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified stream starting at the current readerIndex.
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, 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, 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.
Inherited from io.netty.buffer.PooledByteBuf:
_internalNioBufferalloccapacitycapacitydeallocateduplicateInternalNioBuffergetBytesgetBytesidxinitinitUnpooledinternalNioBufferinternalNioBufferisContiguousmaxFastWritableBytesnioBuffernioBufferCountnioBuffersorderreadBytesreadBytesretainedDuplicateretainedSliceretainedSlicereusesetBytessetBytesunwrap

Field Detail

RECYCLERback to summary
private static final ObjectPool<PooledDirectByteBuf> RECYCLER

Constructor Detail

PooledDirectByteBufback to summary
private PooledDirectByteBuf(ObjectPool.Handle<PooledDirectByteBuf> recyclerHandle, int maxCapacity)

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
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
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
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
private void getBytes(int index, OutputStream out, int length, boolean internal) throws IOException
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
newInstanceback to summary
pack-priv static PooledDirectByteBuf newInstance(int maxCapacity)
newInternalNioBufferback to summary
protected ByteBuffer newInternalNioBuffer(ByteBuffer memory)

Implements abstract io.netty.buffer.PooledByteBuf.newInternalNioBuffer.

Annotations
@Override
readBytesback to summary
public ByteBuf readBytes(byte[] dst, int dstIndex, int length)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Doc from io.netty.buffer.ByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).

Parameters
dstIndex:int

the first index of the destination

length:int

the number of bytes to transfer

Annotations
@Override
readBytesback to summary
public ByteBuf readBytes(ByteBuffer dst)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Doc from io.netty.buffer.ByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination's position reaches its limit, and increases the readerIndex by the number of the transferred bytes.

Annotations
@Override
readBytesback to summary
public ByteBuf readBytes(OutputStream out, int length) throws IOException

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Doc from io.netty.buffer.ByteBuf.readBytes.

Transfers this buffer's data to the specified stream starting at the current readerIndex.

Parameters
length:int

the number of bytes to transfer

Annotations
@Override
Exceptions
IOException:
if the specified stream threw an exception during I/O
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, 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, 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