Top Fields Constructors Methods
io.netty.buffer

pack-priv final Class PooledUnsafeDirectByteBuf

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

Field Summary

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

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.

private long
addr(int index)

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.
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.
pack-priv void
init(PoolChunk<ByteBuffer> chunk, ByteBuffer nioBuffer, long handle, int offset, int length, int maxLength, PoolThreadCache cache)

Overrides io.netty.buffer.PooledByteBuf.init.

private void
pack-priv void
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 PooledUnsafeDirectByteBuf
newInstance(int maxCapacity)

protected ByteBuffer
protected SwappedByteBuf
newSwappedByteBuf()

Overrides io.netty.buffer.AbstractByteBuf.newSwappedByteBuf.

Deprecated as a consequence of SwappedByteBuf being deprecated.
Creates a new SwappedByteBuf for this ByteBuf instance.
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.
public ByteBuf
setZero(int index, int
the number of NULs to write to the buffer
length
)

Overrides io.netty.buffer.AbstractByteBuf.setZero.

Fills this buffer with NUL (0x00) starting at the specified absolute index.
public ByteBuf
writeZero(int
the number of NULs to write to the buffer
length
)

Overrides io.netty.buffer.AbstractByteBuf.writeZero.

Fills this buffer with NUL (0x00) starting at the current writerIndex and increases the writerIndex by the specified length.
Inherited from io.netty.buffer.PooledByteBuf:
_internalNioBufferalloccapacitycapacitydeallocateduplicateInternalNioBuffergetBytesgetBytesidxinternalNioBufferinternalNioBufferisContiguousmaxFastWritableBytesnioBuffernioBufferCountnioBuffersorderreadBytesreadBytesretainedDuplicateretainedSliceretainedSlicereusesetBytessetBytesunwrap

Field Detail

memoryAddressback to summary
private long memoryAddress
RECYCLERback to summary
private static final ObjectPool<PooledUnsafeDirectByteBuf> RECYCLER

Constructor Detail

PooledUnsafeDirectByteBufback to summary
private PooledUnsafeDirectByteBuf(ObjectPool.Handle<PooledUnsafeDirectByteBuf> 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
addrback to summary
private long addr(int index)
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
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
initback to summary
pack-priv void init(PoolChunk<ByteBuffer> chunk, ByteBuffer nioBuffer, long handle, int offset, int length, int maxLength, PoolThreadCache cache)

Overrides io.netty.buffer.PooledByteBuf.init.

Annotations
@Override
initMemoryAddressback to summary
private void initMemoryAddress()
initUnpooledback to summary
pack-priv void initUnpooled(PoolChunk<ByteBuffer> chunk, int length)

Overrides io.netty.buffer.PooledByteBuf.initUnpooled.

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 PooledUnsafeDirectByteBuf newInstance(int maxCapacity)
newInternalNioBufferback to summary
protected ByteBuffer newInternalNioBuffer(ByteBuffer memory)

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

Annotations
@Override
newSwappedByteBufback to summary
protected SwappedByteBuf newSwappedByteBuf()

Overrides io.netty.buffer.AbstractByteBuf.newSwappedByteBuf.

Doc from io.netty.buffer.AbstractByteBuf.newSwappedByteBuf.

Deprecated

as a consequence of SwappedByteBuf being deprecated. See corresponding docs for further information.

Creates a new SwappedByteBuf for this ByteBuf instance.

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, 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
setZeroback to summary
public ByteBuf setZero(int index, int length)

Overrides io.netty.buffer.AbstractByteBuf.setZero.

Doc from io.netty.buffer.ByteBuf.setZero.

Fills this buffer with NUL (0x00) starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.

Parameters
length:int

the number of NULs to write to the buffer

Annotations
@Override
writeZeroback to summary
public ByteBuf writeZero(int length)

Overrides io.netty.buffer.AbstractByteBuf.writeZero.

Doc from io.netty.buffer.ByteBuf.writeZero.

Fills this buffer with NUL (0x00) starting at the current writerIndex and increases the writerIndex by the specified length. If this.writableBytes is less than length, ensureWritable(int) will be called in an attempt to expand capacity to accommodate.

Parameters
length:int

the number of NULs to write to the buffer

Annotations
@Override