public class UnpooledUnsafeHeapByteBuf extends UnpooledHeapByteBuf
AbstractByteBufAllocator.heapBuffer(int, int)
, Unpooled.buffer(int)
and
Unpooled.wrappedBuffer(byte[])
instead of calling the constructor explicitly.Constructor and Description |
---|
UnpooledUnsafeHeapByteBuf(ByteBufAllocator alloc,
int initialCapacity,
int maxCapacity)
Creates a new heap buffer with a newly allocated byte array.
|
Modifier and Type | Method and Description |
---|---|
protected byte |
_getByte(int index) |
protected int |
_getInt(int index) |
protected int |
_getIntLE(int index) |
protected long |
_getLong(int index) |
protected long |
_getLongLE(int index) |
protected short |
_getShort(int index) |
protected short |
_getShortLE(int index) |
protected int |
_getUnsignedMedium(int index) |
protected int |
_getUnsignedMediumLE(int index) |
protected void |
_setByte(int index,
int value) |
protected void |
_setInt(int index,
int value) |
protected void |
_setIntLE(int index,
int value) |
protected void |
_setLong(int index,
long value) |
protected void |
_setLongLE(int index,
long value) |
protected void |
_setMedium(int index,
int value) |
protected void |
_setMediumLE(int index,
int value) |
protected void |
_setShort(int index,
int value) |
protected void |
_setShortLE(int index,
int value) |
protected byte[] |
allocateArray(int initialCapacity) |
byte |
getByte(int index)
Gets a byte at the specified absolute
index in this buffer. |
int |
getInt(int index)
Gets a 32-bit integer at the specified absolute
index in
this buffer. |
int |
getIntLE(int index)
Gets a 32-bit integer at the specified absolute
index in
this buffer with Little Endian Byte Order. |
long |
getLong(int index)
Gets a 64-bit long integer at the specified absolute
index in
this buffer. |
long |
getLongLE(int index)
Gets a 64-bit long integer at the specified absolute
index in
this buffer in Little Endian Byte Order. |
short |
getShort(int index)
Gets a 16-bit short integer at the specified absolute
index in
this buffer. |
short |
getShortLE(int index)
Gets a 16-bit short integer at the specified absolute
index in
this buffer in Little Endian Byte Order. |
int |
getUnsignedMedium(int index)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer. |
int |
getUnsignedMediumLE(int index)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer in Little Endian Byte Order. |
protected SwappedByteBuf |
newSwappedByteBuf()
Deprecated.
|
ByteBuf |
setByte(int index,
int value)
Sets the specified byte at the specified absolute
index in this
buffer. |
ByteBuf |
setInt(int index,
int value)
Sets the specified 32-bit integer at the specified absolute
index in this buffer. |
ByteBuf |
setIntLE(int index,
int value)
Sets the specified 32-bit integer at the specified absolute
index in this buffer with Little Endian byte order
. |
ByteBuf |
setLong(int index,
long value)
Sets the specified 64-bit long integer at the specified absolute
index in this buffer. |
ByteBuf |
setLongLE(int index,
long value)
Sets the specified 64-bit long integer at the specified absolute
index in this buffer in Little Endian Byte Order. |
ByteBuf |
setMedium(int index,
int value)
Sets the specified 24-bit medium integer at the specified absolute
index in this buffer. |
ByteBuf |
setMediumLE(int index,
int value)
Sets the specified 24-bit medium integer at the specified absolute
index in this buffer in the Little Endian Byte Order. |
ByteBuf |
setShort(int index,
int value)
Sets the specified 16-bit short integer at the specified absolute
index in this buffer. |
ByteBuf |
setShortLE(int index,
int value)
Sets the specified 16-bit short integer at the specified absolute
index in this buffer with the Little Endian Byte Order. |
ByteBuf |
setZero(int index,
int length)
Fills this buffer with NUL (0x00) starting at the specified
absolute
index . |
ByteBuf |
writeZero(int length)
Fills this buffer with NUL (0x00) starting at the current
writerIndex and increases the writerIndex by the
specified length . |
alloc, array, arrayOffset, capacity, capacity, copy, deallocate, freeArray, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, hasArray, hasMemoryAddress, internalNioBuffer, isContiguous, isDirect, memoryAddress, nioBuffer, nioBufferCount, nioBuffers, order, readBytes, readBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, unwrap
refCnt, release, release, resetRefCnt, retain, retain, setRefCnt, touch, touch
adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getMedium, getMediumLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, skipBytes, slice, slice, toString, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE
asByteBuf, getDoubleLE, getFloatLE, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE
public UnpooledUnsafeHeapByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity)
initialCapacity
- the initial capacity of the underlying byte arraymaxCapacity
- the max capacity of the underlying byte arrayprotected byte[] allocateArray(int initialCapacity)
allocateArray
in class UnpooledHeapByteBuf
public byte getByte(int index)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.getByte
in class UnpooledHeapByteBuf
protected byte _getByte(int index)
_getByte
in class UnpooledHeapByteBuf
public short getShort(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getShort
in class UnpooledHeapByteBuf
protected short _getShort(int index)
_getShort
in class UnpooledHeapByteBuf
public short getShortLE(int index)
ByteBuf
index
in
this buffer in Little Endian Byte Order. This method does not modify
readerIndex
or writerIndex
of this buffer.getShortLE
in class UnpooledHeapByteBuf
protected short _getShortLE(int index)
_getShortLE
in class UnpooledHeapByteBuf
public int getUnsignedMedium(int index)
ByteBuf
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.getUnsignedMedium
in class UnpooledHeapByteBuf
protected int _getUnsignedMedium(int index)
_getUnsignedMedium
in class UnpooledHeapByteBuf
public int getUnsignedMediumLE(int index)
ByteBuf
index
in this buffer in Little Endian Byte Order.
This method does not modify readerIndex
or
writerIndex
of this buffer.getUnsignedMediumLE
in class UnpooledHeapByteBuf
protected int _getUnsignedMediumLE(int index)
_getUnsignedMediumLE
in class UnpooledHeapByteBuf
public int getInt(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getInt
in class UnpooledHeapByteBuf
protected int _getInt(int index)
_getInt
in class UnpooledHeapByteBuf
public int getIntLE(int index)
ByteBuf
index
in
this buffer with Little Endian Byte Order. This method does not
modify readerIndex
or writerIndex
of this buffer.getIntLE
in class UnpooledHeapByteBuf
protected int _getIntLE(int index)
_getIntLE
in class UnpooledHeapByteBuf
public long getLong(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getLong
in class UnpooledHeapByteBuf
protected long _getLong(int index)
_getLong
in class UnpooledHeapByteBuf
public long getLongLE(int index)
ByteBuf
index
in
this buffer in Little Endian Byte Order. This method does not
modify readerIndex
or writerIndex
of this buffer.getLongLE
in class UnpooledHeapByteBuf
protected long _getLongLE(int index)
_getLongLE
in class UnpooledHeapByteBuf
public ByteBuf setByte(int index, int value)
ByteBuf
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.setByte
in class UnpooledHeapByteBuf
protected void _setByte(int index, int value)
_setByte
in class UnpooledHeapByteBuf
public ByteBuf setShort(int index, int value)
ByteBuf
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.setShort
in class UnpooledHeapByteBuf
protected void _setShort(int index, int value)
_setShort
in class UnpooledHeapByteBuf
public ByteBuf setShortLE(int index, int value)
ByteBuf
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.setShortLE
in class UnpooledHeapByteBuf
protected void _setShortLE(int index, int value)
_setShortLE
in class UnpooledHeapByteBuf
public ByteBuf setMedium(int index, int value)
ByteBuf
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.setMedium
in class UnpooledHeapByteBuf
protected void _setMedium(int index, int value)
_setMedium
in class UnpooledHeapByteBuf
public ByteBuf setMediumLE(int index, int value)
ByteBuf
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.setMediumLE
in class UnpooledHeapByteBuf
protected void _setMediumLE(int index, int value)
_setMediumLE
in class UnpooledHeapByteBuf
public ByteBuf setInt(int index, int value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setInt
in class UnpooledHeapByteBuf
protected void _setInt(int index, int value)
_setInt
in class UnpooledHeapByteBuf
public ByteBuf setIntLE(int index, int value)
ByteBuf
index
in this buffer with Little Endian byte order
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setIntLE
in class UnpooledHeapByteBuf
protected void _setIntLE(int index, int value)
_setIntLE
in class UnpooledHeapByteBuf
public ByteBuf setLong(int index, long value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setLong
in class UnpooledHeapByteBuf
protected void _setLong(int index, long value)
_setLong
in class UnpooledHeapByteBuf
public ByteBuf setLongLE(int index, long value)
ByteBuf
index
in this buffer in Little Endian Byte Order.
This method does not modify readerIndex
or writerIndex
of
this buffer.setLongLE
in class UnpooledHeapByteBuf
protected void _setLongLE(int index, long value)
_setLongLE
in class UnpooledHeapByteBuf
public ByteBuf setZero(int index, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setZero
in class AbstractByteBuf
length
- the number of NULs to write to the bufferpublic ByteBuf writeZero(int length)
ByteBuf
writerIndex
and increases the writerIndex
by the
specified length
.
If this.writableBytes
is less than length
, ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.writeZero
in class AbstractByteBuf
length
- the number of NULs to write to the buffer@Deprecated protected SwappedByteBuf newSwappedByteBuf()
AbstractByteBuf
SwappedByteBuf
for this ByteBuf
instance.newSwappedByteBuf
in class AbstractByteBuf
Copyright © 2008–2024 The Netty Project. All rights reserved.