final class ReadOnlyUnsafeDirectByteBuf extends ReadOnlyByteBufferBuf
Modifier and Type | Field and Description |
---|---|
private long |
memoryAddress |
buffer
leakDetector, readerIndex, writerIndex
Constructor and Description |
---|
ReadOnlyUnsafeDirectByteBuf(ByteBufAllocator allocator,
java.nio.ByteBuffer buffer) |
Modifier and Type | Method and Description |
---|---|
protected byte |
_getByte(int index) |
protected int |
_getInt(int index) |
protected long |
_getLong(int index) |
protected short |
_getShort(int index) |
protected int |
_getUnsignedMedium(int index) |
private long |
addr(int index) |
ByteBuf |
copy(int index,
int length)
Returns a copy of this buffer's sub-region.
|
ByteBuf |
getBytes(int index,
byte[] dst,
int dstIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index . |
ByteBuf |
getBytes(int index,
java.nio.ByteBuffer dst)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index until the destination's position
reaches its limit. |
ByteBuf |
getBytes(int index,
ByteBuf dst,
int dstIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index . |
_setByte, _setInt, _setLong, _setMedium, _setShort, alloc, array, arrayOffset, capacity, capacity, deallocate, getByte, getBytes, getBytes, getInt, getLong, getShort, getUnsignedMedium, hasArray, hasMemoryAddress, internalNioBuffer, internalNioBuffer, isDirect, memoryAddress, nioBuffer, nioBufferCount, nioBuffers, order, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, setInt, setLong, setMedium, setShort, unwrap
refCnt, release, release, retain, retain, setRefCnt
adjustMarkers, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkIndex, checkIndex, checkIndex0, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardMarks, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getMedium, getUnsignedByte, getUnsignedInt, getUnsignedShort, hashCode, indexOf, isReadable, isReadable, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, resetReaderIndex, resetWriterIndex, setBoolean, setBytes, setBytes, setBytes, setChar, setDouble, setFloat, setIndex, setIndex0, setZero, skipBytes, slice, slice, toString, toString, toString, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writerIndex, writerIndex, writeShort, writeZero
ReadOnlyUnsafeDirectByteBuf(ByteBufAllocator allocator, java.nio.ByteBuffer buffer)
protected byte _getByte(int index)
_getByte
in class ReadOnlyByteBufferBuf
protected short _getShort(int index)
_getShort
in class ReadOnlyByteBufferBuf
protected int _getUnsignedMedium(int index)
_getUnsignedMedium
in class ReadOnlyByteBufferBuf
protected int _getInt(int index)
_getInt
in class ReadOnlyByteBufferBuf
protected long _getLong(int index)
_getLong
in class ReadOnlyByteBufferBuf
public ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of both the source (i.e. this
) and the destination.getBytes
in class ReadOnlyByteBufferBuf
dstIndex
- the first index of the destinationlength
- the number of bytes to transferpublic ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of this buffer.getBytes
in class ReadOnlyByteBufferBuf
dstIndex
- the first index of the destinationlength
- the number of bytes to transferpublic ByteBuf getBytes(int index, java.nio.ByteBuffer dst)
ByteBuf
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.getBytes
in class ReadOnlyByteBufferBuf
public ByteBuf copy(int index, int length)
ByteBuf
readerIndex
or writerIndex
of
this buffer.copy
in class ReadOnlyByteBufferBuf
private long addr(int index)