ByteBuffer based buffer. It is recommended to use
UnpooledByteBufAllocator#directBuffer(int, int), Unpooled#directBuffer(int) and
Unpooled#wrappedBuffer(ByteBuffer) instead of calling the constructor explicitly.}
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long |
| Access | Constructor and Description |
|---|---|
| public | UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, int
the initial capacity of the underlying direct buffer initialCapacity, int the maximum capacity of the underlying direct buffer maxCapacity)Creates a new direct buffer. |
| protected | UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int
the maximum capacity of the underlying direct buffer maxCapacity)Creates a new direct buffer by wrapping the specified initial buffer. |
| pack-priv | UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity, boolean doFree)
|
| Modifier and Type | Method and Description |
|---|---|
| protected byte | |
| protected int | |
| protected int | |
| protected long | |
| protected long | |
| protected short | |
| protected short | |
| protected int | |
| protected int | _getUnsignedMediumLE(int index)
Overrides io. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| pack-priv final long | |
| public ByteBuf | copy(int index, int length)
Overrides io. |
| public byte | getByte(int index)
Overrides io. 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)Overrides io. index.
|
| pack-priv void | getBytes(int index, byte[] dst, int dstIndex, int length, boolean internal)
|
| pack-priv void | getBytes(int index, ByteBuffer dst, boolean internal)
|
| pack-priv void | getBytes(int index, OutputStream out, int length, boolean internal)
|
| public int | getInt(int index)
Overrides io. index in
this buffer.
|
| public long | getLong(int index)
Overrides io. index in
this buffer.
|
| public short | getShort(int index)
Overrides io. index in
this buffer.
|
| public int | getUnsignedMedium(int index)
Overrides io. index in this buffer.
|
| public boolean | hasMemoryAddress()
Overrides io. true if and only if this buffer has a reference to the low-level memory address that points
to the backing data.
|
| public long | memoryAddress()
Overrides io. |
| protected SwappedByteBuf | newSwappedByteBuf()
Overrides io.
Deprecated
as a consequence of
Creates a new SwappedByteBuf being deprecated.
SwappedByteBuf for this ByteBuf instance.
|
| public ByteBuf | setByte(int index, int value)
Overrides io. index in this
buffer.
|
| pack-priv final void | setByteBuffer(ByteBuffer buffer, boolean tryFree)
Overrides io. |
| public ByteBuf | setBytes(int index, ByteBuf src, int
the first index of the source srcIndex, int the number of bytes to transfer length)Overrides io. index.
|
| public ByteBuf | setBytes(int index, byte[] src, int srcIndex, int length)
Overrides io. index.
|
| public ByteBuf | setBytes(int index, ByteBuffer src)
Overrides io. 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)Overrides io. index.
|
| public ByteBuf | setInt(int index, int value)
Overrides io. index in this buffer.
|
| public ByteBuf | setLong(int index, long value)
Overrides io. index in this buffer.
|
| public ByteBuf | setMedium(int index, int value)
Overrides io. index in this buffer.
|
| public ByteBuf | setShort(int index, int value)
Overrides io. index in this buffer.
|
| public ByteBuf | setZero(int index, int
the number of NULs to write to the buffer length)Overrides io. index.
|
| public ByteBuf | writeZero(int
the number of NULs to write to the buffer length)Overrides io. writerIndex and increases the writerIndex by the
specified length.
|
| memoryAddress | back to summary |
|---|---|
| pack-priv long memoryAddress | |
| UnpooledUnsafeDirectByteBuf | back to summary |
|---|---|
| public UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) Creates a new direct buffer.
| |
| UnpooledUnsafeDirectByteBuf | back to summary |
|---|---|
| protected UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity) Creates a new direct buffer by wrapping the specified initial buffer.
| |
| UnpooledUnsafeDirectByteBuf | back to summary |
|---|---|
| pack-priv UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity, boolean doFree) | |
| _getByte | back to summary |
|---|---|
| protected byte _getByte(int index) Overrides io.
| |
| _getInt | back to summary |
|---|---|
| protected int _getInt(int index) Overrides io.
| |
| _getIntLE | back to summary |
|---|---|
| protected int _getIntLE(int index) Overrides io.
| |
| _getLong | back to summary |
|---|---|
| protected long _getLong(int index) Overrides io.
| |
| _getLongLE | back to summary |
|---|---|
| protected long _getLongLE(int index) Overrides io.
| |
| _getShort | back to summary |
|---|---|
| protected short _getShort(int index) Overrides io.
| |
| _getShortLE | back to summary |
|---|---|
| protected short _getShortLE(int index) Overrides io.
| |
| _getUnsignedMedium | back to summary |
|---|---|
| protected int _getUnsignedMedium(int index) Overrides io.
| |
| _getUnsignedMediumLE | back to summary |
|---|---|
| protected int _getUnsignedMediumLE(int index) Overrides io.
| |
| _setByte | back to summary |
|---|---|
| protected void _setByte(int index, int value) Overrides io.
| |
| _setInt | back to summary |
|---|---|
| protected void _setInt(int index, int value) Overrides io.
| |
| _setIntLE | back to summary |
|---|---|
| protected void _setIntLE(int index, int value) Overrides io.
| |
| _setLong | back to summary |
|---|---|
| protected void _setLong(int index, long value) Overrides io.
| |
| _setLongLE | back to summary |
|---|---|
| protected void _setLongLE(int index, long value) Overrides io.
| |
| _setMedium | back to summary |
|---|---|
| protected void _setMedium(int index, int value) Overrides io.
| |
| _setMediumLE | back to summary |
|---|---|
| protected void _setMediumLE(int index, int value) Overrides io.
| |
| _setShort | back to summary |
|---|---|
| protected void _setShort(int index, int value) Overrides io.
| |
| _setShortLE | back to summary |
|---|---|
| protected void _setShortLE(int index, int value) Overrides io.
| |
| addr | back to summary |
|---|---|
| pack-priv final long addr(int index) | |
| copy | back to summary |
|---|---|
| public ByteBuf copy(int index, int length) Overrides io. Doc from io. 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
| |
| getByte | back to summary |
|---|---|
| public byte getByte(int index) Overrides io. Doc from io. Gets a byte at the specified absolute
| |
| getBytes | back to summary |
|---|---|
| public ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length) Overrides io. Doc from io. Transfers this buffer's data to the specified destination starting at
the specified absolute
| |
| getBytes | back to summary |
|---|---|
| pack-priv void getBytes(int index, byte[] dst, int dstIndex, int length, boolean internal) Overrides io.
| |
| getBytes | back to summary |
|---|---|
| pack-priv void getBytes(int index, ByteBuffer dst, boolean internal) Overrides io.
| |
| getBytes | back to summary |
|---|---|
| pack-priv void getBytes(int index, OutputStream out, int length, boolean internal) throws IOException Overrides io.
| |
| getInt | back to summary |
|---|---|
| public int getInt(int index) Overrides io. Doc from io. Gets a 32-bit integer at the specified absolute
| |
| getLong | back to summary |
|---|---|
| public long getLong(int index) Overrides io. Doc from io. Gets a 64-bit long integer at the specified absolute
| |
| getShort | back to summary |
|---|---|
| public short getShort(int index) Overrides io. Doc from io. Gets a 16-bit short integer at the specified absolute
| |
| getUnsignedMedium | back to summary |
|---|---|
| public int getUnsignedMedium(int index) Overrides io. Doc from io. Gets an unsigned 24-bit medium integer at the specified absolute
| |
| hasMemoryAddress | back to summary |
|---|---|
| public boolean hasMemoryAddress() Overrides io. Doc from io. Returns
| |
| memoryAddress | back to summary |
|---|---|
| public long memoryAddress() Overrides io. Doc from io. Returns the low-level memory address that point to the first byte of ths backing data.
| |
| newSwappedByteBuf | back to summary |
|---|---|
| protected SwappedByteBuf newSwappedByteBuf() Overrides io. Doc from io. Deprecated as a consequence of Creates a new
| |
| setByte | back to summary |
|---|---|
| public ByteBuf setByte(int index, int value) Overrides io. Doc from io. Sets the specified byte at the specified absolute
| |
| setByteBuffer | back to summary |
|---|---|
| pack-priv final void setByteBuffer(ByteBuffer buffer, boolean tryFree) Overrides io.
| |
| setBytes | back to summary |
|---|---|
| public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) Overrides io. Doc from io. Transfers the specified source buffer's data to this buffer starting at
the specified absolute
| |
| setBytes | back to summary |
|---|---|
| public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) Overrides io. Doc from io. Transfers the specified source array's data to this buffer starting at
the specified absolute
| |
| setBytes | back to summary |
|---|---|
| public ByteBuf setBytes(int index, ByteBuffer src) Overrides io. Doc from io. Transfers the specified source buffer's data to this buffer starting at
the specified absolute
| |
| setBytes | back to summary |
|---|---|
| public int setBytes(int index, InputStream in, int length) throws IOException Overrides io. Doc from io. Transfers the content of the specified source stream to this buffer
starting at the specified absolute
| |
| setInt | back to summary |
|---|---|
| public ByteBuf setInt(int index, int value) Overrides io. Doc from io. Sets the specified 32-bit integer at the specified absolute
| |
| setLong | back to summary |
|---|---|
| public ByteBuf setLong(int index, long value) Overrides io. Doc from io. Sets the specified 64-bit long integer at the specified absolute
| |
| setMedium | back to summary |
|---|---|
| public ByteBuf setMedium(int index, int value) Overrides io. Doc from io. Sets the specified 24-bit medium integer at the specified absolute
| |
| setShort | back to summary |
|---|---|
| public ByteBuf setShort(int index, int value) Overrides io. Doc from io. Sets the specified 16-bit short integer at the specified absolute
| |
| setZero | back to summary |
|---|---|
| public ByteBuf setZero(int index, int length) Overrides io. Doc from io. Fills this buffer with NUL (0x00) starting at the specified
absolute
| |
| writeZero | back to summary |
|---|---|
| public ByteBuf writeZero(int length) Overrides io. Doc from io. Fills this buffer with NUL (0x00) starting at the current
| |