Class UnpooledUnsafeHeapByteBuf

    • Constructor Detail

      • UnpooledUnsafeHeapByteBuf

        public UnpooledUnsafeHeapByteBuf​(ByteBufAllocator alloc,
                                         int initialCapacity,
                                         int maxCapacity)
        Creates a new heap buffer with a newly allocated byte array.
        Parameters:
        initialCapacity - the initial capacity of the underlying byte array
        maxCapacity - the max capacity of the underlying byte array
    • Method Detail

      • getByte

        public byte getByte​(int index)
        Description copied from class: ByteBuf
        Gets a byte at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getByte in class UnpooledHeapByteBuf
      • getShort

        public short getShort​(int index)
        Description copied from class: ByteBuf
        Gets a 16-bit short integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getShort in class UnpooledHeapByteBuf
      • getShortLE

        public short getShortLE​(int index)
        Description copied from class: ByteBuf
        Gets a 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getShortLE in class UnpooledHeapByteBuf
      • getUnsignedMedium

        public int getUnsignedMedium​(int index)
        Description copied from class: ByteBuf
        Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getUnsignedMedium in class UnpooledHeapByteBuf
      • getUnsignedMediumLE

        public int getUnsignedMediumLE​(int index)
        Description copied from class: ByteBuf
        Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getUnsignedMediumLE in class UnpooledHeapByteBuf
      • getInt

        public int getInt​(int index)
        Description copied from class: ByteBuf
        Gets a 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getInt in class UnpooledHeapByteBuf
      • getIntLE

        public int getIntLE​(int index)
        Description copied from class: ByteBuf
        Gets a 32-bit integer at the specified absolute index in this buffer with Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getIntLE in class UnpooledHeapByteBuf
      • getLong

        public long getLong​(int index)
        Description copied from class: ByteBuf
        Gets a 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getLong in class UnpooledHeapByteBuf
      • getLongLE

        public long getLongLE​(int index)
        Description copied from class: ByteBuf
        Gets a 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        getLongLE in class UnpooledHeapByteBuf
      • setByte

        public ByteBuf setByte​(int index,
                               int value)
        Description copied from class: ByteBuf
        Sets the specified byte at the specified absolute 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.
        Overrides:
        setByte in class UnpooledHeapByteBuf
      • setShort

        public ByteBuf setShort​(int index,
                                int value)
        Description copied from class: ByteBuf
        Sets the specified 16-bit short integer at the specified absolute 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.
        Overrides:
        setShort in class UnpooledHeapByteBuf
      • setShortLE

        public ByteBuf setShortLE​(int index,
                                  int value)
        Description copied from class: ByteBuf
        Sets the specified 16-bit short integer at the specified absolute 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.
        Overrides:
        setShortLE in class UnpooledHeapByteBuf
      • setMedium

        public ByteBuf setMedium​(int index,
                                 int value)
        Description copied from class: ByteBuf
        Sets the specified 24-bit medium integer at the specified absolute 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.
        Overrides:
        setMedium in class UnpooledHeapByteBuf
      • setMediumLE

        public ByteBuf setMediumLE​(int index,
                                   int value)
        Description copied from class: ByteBuf
        Sets the specified 24-bit medium integer at the specified absolute 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.
        Overrides:
        setMediumLE in class UnpooledHeapByteBuf
      • setInt

        public ByteBuf setInt​(int index,
                              int value)
        Description copied from class: ByteBuf
        Sets the specified 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        setInt in class UnpooledHeapByteBuf
      • setIntLE

        public ByteBuf setIntLE​(int index,
                                int value)
        Description copied from class: ByteBuf
        Sets the specified 32-bit integer at the specified absolute index in this buffer with Little Endian byte order . This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        setIntLE in class UnpooledHeapByteBuf
      • setLong

        public ByteBuf setLong​(int index,
                               long value)
        Description copied from class: ByteBuf
        Sets the specified 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        setLong in class UnpooledHeapByteBuf
      • setLongLE

        public ByteBuf setLongLE​(int index,
                                 long value)
        Description copied from class: ByteBuf
        Sets the specified 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        setLongLE in class UnpooledHeapByteBuf
      • setZero

        public ByteBuf setZero​(int index,
                               int length)
        Description copied from class: ByteBuf
        Fills this buffer with NUL (0x00) starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Overrides:
        setZero in class AbstractByteBuf
        length - the number of NULs to write to the buffer
      • writeZero

        public ByteBuf writeZero​(int length)
        Description copied from class: ByteBuf
        Fills this buffer with NUL (0x00) starting at the current 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.
        Overrides:
        writeZero in class AbstractByteBuf
        Parameters:
        length - the number of NULs to write to the buffer