Class ReadOnlyUnsafeDirectByteBuf

    • Field Detail

      • memoryAddress

        private final long memoryAddress
    • Constructor Detail

      • ReadOnlyUnsafeDirectByteBuf

        ReadOnlyUnsafeDirectByteBuf​(ByteBufAllocator allocator,
                                    java.nio.ByteBuffer byteBuffer)
    • Method Detail

      • getBytes

        public ByteBuf getBytes​(int index,
                                ByteBuf dst,
                                int dstIndex,
                                int length)
        Description copied from class: ByteBuf
        Transfers this buffer's data to the specified destination starting at the specified absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.
        Overrides:
        getBytes in class ReadOnlyByteBufferBuf
        dstIndex - the first index of the destination
        length - the number of bytes to transfer
      • getBytes

        public ByteBuf getBytes​(int index,
                                byte[] dst,
                                int dstIndex,
                                int length)
        Description copied from class: ByteBuf
        Transfers this buffer's data to the specified destination starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getBytes in class ReadOnlyByteBufferBuf
        dstIndex - the first index of the destination
        length - the number of bytes to transfer
      • copy

        public ByteBuf copy​(int index,
                            int length)
        Description copied from class: ByteBuf
        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 readerIndex or writerIndex of this buffer.
        Overrides:
        copy in class ReadOnlyByteBufferBuf
      • hasMemoryAddress

        public boolean hasMemoryAddress()
        Description copied from class: ByteBuf
        Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.
        Overrides:
        hasMemoryAddress in class ReadOnlyByteBufferBuf
      • memoryAddress

        public long memoryAddress()
        Description copied from class: ByteBuf
        Returns the low-level memory address that point to the first byte of ths backing data.
        Overrides:
        memoryAddress in class ReadOnlyByteBufferBuf
      • addr

        private long addr​(int index)