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 |
|---|---|
| private final ByteBufAllocator | |
| pack-priv ByteBuffer | |
| private int | |
| private boolean | |
| private ByteBuffer |
| Access | Constructor and Description |
|---|---|
| public | UnpooledDirectByteBuf(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 | UnpooledDirectByteBuf(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 | UnpooledDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity, boolean doFree, boolean slice)
|
| Modifier and Type | Method and Description |
|---|---|
| protected byte | |
| protected int | |
| protected int | |
| protected long | |
| protected long | |
| protected short | |
| protected short | |
| protected int | _getUnsignedMedium(int index)
Implements abstract io. |
| protected int | _getUnsignedMediumLE(int index)
Implements abstract io. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public ByteBufAllocator | alloc()
Implements abstract io. ByteBufAllocator which created this buffer.
|
| protected ByteBuffer | |
| public byte[] | array()
Implements abstract io. |
| public int | arrayOffset()
Implements abstract io. |
| public int | capacity()
Implements abstract io. |
| public ByteBuf | capacity(int newCapacity)
Implements abstract io. |
| public ByteBuf | copy(int index, int length)
Implements abstract io. |
| protected void | deallocate()
Implements abstract io. refCnt() is equals 0.
|
| protected void | |
| 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)Implements abstract io. 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. index.
|
| pack-priv void | |
| public ByteBuf | getBytes(int index, ByteBuffer dst)
Implements abstract io. index until the destination's position
reaches its limit.
|
| pack-priv void | |
| public ByteBuf | getBytes(int index, OutputStream out, int
the number of bytes to transfer length)Implements abstract io. index.
|
| pack-priv void | |
| public int | getBytes(int index, GatheringByteChannel out, int
the maximum number of bytes to transfer length)Implements abstract io. index.
|
| private int | |
| public int | getBytes(int index, FileChannel out, long
the file position at which the transfer is to begin position, int the maximum number of bytes to transfer length)Implements abstract io. index
to the specified channel starting at the given file position.
|
| private int | |
| 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 | hasArray()
Implements abstract io. true if and only if this buffer has a backing byte array.
|
| public boolean | hasMemoryAddress()
Implements abstract io. true if and only if this buffer has a reference to the low-level memory address that points
to the backing data.
|
| public ByteBuffer | internalNioBuffer(int index, int length)
Implements abstract io. |
| private ByteBuffer | |
| public final boolean | isContiguous()
Overrides io. true if this ByteBuf implementation is backed by a single memory region.
|
| public boolean | isDirect()
Implements abstract io. true if and only if this buffer is backed by an
NIO direct buffer.
|
| public long | memoryAddress()
Implements abstract io. |
| public ByteBuffer | nioBuffer(int index, int length)
Implements abstract io. ByteBuffer.
|
| public int | nioBufferCount()
Implements abstract io. ByteBuffers that consist this buffer.
|
| public ByteBuffer[] | nioBuffers(int index, int length)
Implements abstract io. ByteBuffer's for the specified index and length
The returned buffer either share or contains the copied content of this buffer, while changing
the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer.
|
| public ByteOrder | |
| public ByteBuf | readBytes(byte[] dst, int
the first index of the destination dstIndex, int the number of bytes to transfer length)Overrides io. readerIndex and increases the readerIndex
by the number of the transferred bytes (= length).
|
| public ByteBuf | readBytes(ByteBuffer dst)
Overrides io. 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. readerIndex.
|
| public int | readBytes(GatheringByteChannel out, int
the maximum number of bytes to transfer length)Overrides io. readerIndex.
|
| public int | readBytes(FileChannel out, long
the file position at which the transfer is to begin position, int the maximum number of bytes to transfer length)Overrides io. readerIndex
to the specified channel starting at the given file position.
|
| public ByteBuf | setByte(int index, int value)
Overrides io. index in this
buffer.
|
| pack-priv void | |
| 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. index.
|
| public ByteBuf | setBytes(int index, byte[] src, int srcIndex, int length)
Implements abstract io. index.
|
| public ByteBuf | setBytes(int index, ByteBuffer src)
Implements abstract 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)Implements abstract io. index.
|
| public int | setBytes(int index, ScatteringByteChannel in, int
the maximum number of bytes to transfer length)Implements abstract io. index.
|
| public int | setBytes(int index, FileChannel in, long
the file position at which the transfer is to begin position, int the maximum number of bytes to transfer length)Implements abstract 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 | unwrap()
Implements abstract io. |