Top Description Fields Constructors Methods
io.netty.buffer

public Class UnpooledUnsafeHeapByteBuf

extends UnpooledHeapByteBuf
Class Inheritance
Known Direct Subclasses
io.netty.buffer.UnpooledByteBufAllocator.InstrumentedUnpooledUnsafeHeapByteBuf
Imports
io.netty.util.internal.PlatformDependent

Big endian Java heap buffer implementation. It is recommended to use UnpooledByteBufAllocator#heapBuffer(int, int), Unpooled#buffer(int) and Unpooled#wrappedBuffer(byte[]) instead of calling the constructor explicitly.

Field Summary

Inherited from io.netty.buffer.UnpooledHeapByteBuf:
array

Constructor Summary

AccessConstructor and Description
public
UnpooledUnsafeHeapByteBuf(ByteBufAllocator alloc, int
the initial capacity of the underlying byte array
initialCapacity
,
int
the max capacity of the underlying byte array
maxCapacity
)

Creates a new heap buffer with a newly allocated byte array.

Method Summary

Modifier and TypeMethod and Description
protected byte
protected int
protected int
protected long
protected long
protected short
protected short
protected int
protected int
protected void
protected void
_setInt(int index, int value)

Overrides io.netty.buffer.UnpooledHeapByteBuf._setInt.

protected void
protected void
_setLong(int index, long value)

Overrides io.netty.buffer.UnpooledHeapByteBuf._setLong.

protected void
protected void
protected void
protected void
protected void
protected byte[]
public byte
getByte(int index)

Overrides io.netty.buffer.UnpooledHeapByteBuf.getByte.

Gets a byte at the specified absolute index in this buffer.
public int
getInt(int index)

Overrides io.netty.buffer.UnpooledHeapByteBuf.getInt.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.getLong.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.getShort.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.getUnsignedMediumLE.

Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer in Little Endian Byte Order.
protected SwappedByteBuf
newSwappedByteBuf()

Overrides io.netty.buffer.AbstractByteBuf.newSwappedByteBuf.

Deprecated
Creates a new SwappedByteBuf for this ByteBuf instance.
public ByteBuf
setByte(int index, int value)

Overrides io.netty.buffer.UnpooledHeapByteBuf.setByte.

Sets the specified byte at the specified absolute index in this buffer.
public ByteBuf
setInt(int index, int value)

Overrides io.netty.buffer.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.setShortLE.

Sets the specified 16-bit short integer at the specified absolute index in this buffer with the Little Endian Byte Order.
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.UnpooledHeapByteBuf:
allocarrayarrayOffsetcapacitycapacitycopydeallocatefreeArraygetBytesgetBytesgetBytesgetBytesgetBytesgetByteshasArrayhasMemoryAddressinternalNioBufferisContiguousisDirectmemoryAddressnioBuffernioBufferCountnioBuffersorderreadBytesreadBytessetBytessetBytessetBytessetBytessetBytessetBytesunwrap

Constructor Detail

UnpooledUnsafeHeapByteBufback to summary
public UnpooledUnsafeHeapByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity)

Creates a new heap buffer with a newly allocated byte array.

Parameters
initialCapacity:int

the initial capacity of the underlying byte array

maxCapacity:int

the max capacity of the underlying byte array

Method Detail

_getByteback to summary
protected byte _getByte(int index)

Overrides io.netty.buffer.UnpooledHeapByteBuf._getByte.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getInt.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getIntLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getLong.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getLongLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getShort.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getShortLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getUnsignedMedium.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._getUnsignedMediumLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setByte.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setInt.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setIntLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setLong.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setLongLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setMedium.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setMediumLE.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setShort.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf._setShortLE.

Annotations
@Override
allocateArrayback to summary
protected byte[] allocateArray(int initialCapacity)

Overrides io.netty.buffer.UnpooledHeapByteBuf.allocateArray.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf.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
getIntback to summary
public int getInt(int index)

Overrides io.netty.buffer.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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
newSwappedByteBufback to summary
protected SwappedByteBuf newSwappedByteBuf()

Overrides io.netty.buffer.AbstractByteBuf.newSwappedByteBuf.

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

Deprecated

Creates a new SwappedByteBuf for this ByteBuf instance.

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

Overrides io.netty.buffer.UnpooledHeapByteBuf.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
setIntback to summary
public ByteBuf setInt(int index, int value)

Overrides io.netty.buffer.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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.UnpooledHeapByteBuf.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
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