Class DuplicatedByteBuf

    • Constructor Detail

      • DuplicatedByteBuf

        public DuplicatedByteBuf​(ByteBuf buffer)
        Deprecated.
    • Method Detail

      • unwrap

        public ByteBuf unwrap()
        Deprecated.
        Description copied from class: ByteBuf
        Return the underlying buffer instance if this buffer is a wrapper of another buffer.
        Specified by:
        unwrap in class ByteBuf
        Returns:
        null if this buffer is not a wrapper
      • order

        @Deprecated
        public java.nio.ByteOrder order()
        Deprecated.
        Description copied from class: ByteBuf
        Returns the endianness of this buffer.
        Specified by:
        order in class ByteBuf
      • isDirect

        public boolean isDirect()
        Deprecated.
        Description copied from class: ByteBuf
        Returns true if and only if this buffer is backed by an NIO direct buffer.
        Specified by:
        isDirect in class ByteBuf
      • capacity

        public int capacity()
        Deprecated.
        Description copied from class: ByteBuf
        Returns the number of bytes (octets) this buffer can contain.
        Specified by:
        capacity in class ByteBuf
      • capacity

        public ByteBuf capacity​(int newCapacity)
        Deprecated.
        Description copied from class: ByteBuf
        Adjusts the capacity of this buffer. If the newCapacity is less than the current capacity, the content of this buffer is truncated. If the newCapacity is greater than the current capacity, the buffer is appended with unspecified data whose length is (newCapacity - currentCapacity).
        Specified by:
        capacity in class ByteBuf
      • hasArray

        public boolean hasArray()
        Deprecated.
        Description copied from class: ByteBuf
        Returns true if and only if this buffer has a backing byte array. If this method returns true, you can safely call ByteBuf.array() and ByteBuf.arrayOffset().
        Specified by:
        hasArray in class ByteBuf
      • array

        public byte[] array()
        Deprecated.
        Description copied from class: ByteBuf
        Returns the backing byte array of this buffer.
        Specified by:
        array in class ByteBuf
      • arrayOffset

        public int arrayOffset()
        Deprecated.
        Description copied from class: ByteBuf
        Returns the offset of the first byte within the backing byte array of this buffer.
        Specified by:
        arrayOffset in class ByteBuf
      • hasMemoryAddress

        public boolean hasMemoryAddress()
        Deprecated.
        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.
        Specified by:
        hasMemoryAddress in class ByteBuf
      • memoryAddress

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

        public byte getByte​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getShort

        public short getShort​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getShortLE

        public short getShortLE​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getUnsignedMedium

        public int getUnsignedMedium​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getUnsignedMediumLE

        public int getUnsignedMediumLE​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getInt

        public int getInt​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getIntLE

        public int getIntLE​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getLong

        public long getLong​(int index)
        Deprecated.
        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 AbstractByteBuf
      • getLongLE

        public long getLongLE​(int index)
        Deprecated.
        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 AbstractByteBuf
      • copy

        public ByteBuf copy​(int index,
                            int length)
        Deprecated.
        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.
        Specified by:
        copy in class ByteBuf
      • slice

        public ByteBuf slice​(int index,
                             int length)
        Deprecated.
        Description copied from class: ByteBuf
        Returns a slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

        Also be aware that this method will NOT call ByteBuf.retain() and so the reference count will NOT be increased.

        Overrides:
        slice in class AbstractByteBuf
      • getBytes

        public ByteBuf getBytes​(int index,
                                ByteBuf dst,
                                int dstIndex,
                                int length)
        Deprecated.
        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.
        Specified by:
        getBytes in class ByteBuf
        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)
        Deprecated.
        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.
        Specified by:
        getBytes in class ByteBuf
        dstIndex - the first index of the destination
        length - the number of bytes to transfer
      • getBytes

        public ByteBuf getBytes​(int index,
                                java.nio.ByteBuffer dst)
        Deprecated.
        Description copied from class: ByteBuf
        Transfers this buffer's data to the specified destination starting at the specified absolute 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.
        Specified by:
        getBytes in class ByteBuf
      • setByte

        public ByteBuf setByte​(int index,
                               int value)
        Deprecated.
        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 AbstractByteBuf
      • _setByte

        protected void _setByte​(int index,
                                int value)
        Deprecated.
        Specified by:
        _setByte in class AbstractByteBuf
      • setShort

        public ByteBuf setShort​(int index,
                                int value)
        Deprecated.
        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 AbstractByteBuf
      • _setShort

        protected void _setShort​(int index,
                                 int value)
        Deprecated.
        Specified by:
        _setShort in class AbstractByteBuf
      • setShortLE

        public ByteBuf setShortLE​(int index,
                                  int value)
        Deprecated.
        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 AbstractByteBuf
      • _setShortLE

        protected void _setShortLE​(int index,
                                   int value)
        Deprecated.
        Specified by:
        _setShortLE in class AbstractByteBuf
      • setMedium

        public ByteBuf setMedium​(int index,
                                 int value)
        Deprecated.
        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 AbstractByteBuf
      • _setMedium

        protected void _setMedium​(int index,
                                  int value)
        Deprecated.
        Specified by:
        _setMedium in class AbstractByteBuf
      • setMediumLE

        public ByteBuf setMediumLE​(int index,
                                   int value)
        Deprecated.
        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 AbstractByteBuf
      • _setMediumLE

        protected void _setMediumLE​(int index,
                                    int value)
        Deprecated.
        Specified by:
        _setMediumLE in class AbstractByteBuf
      • setInt

        public ByteBuf setInt​(int index,
                              int value)
        Deprecated.
        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 AbstractByteBuf
      • _setInt

        protected void _setInt​(int index,
                               int value)
        Deprecated.
        Specified by:
        _setInt in class AbstractByteBuf
      • setIntLE

        public ByteBuf setIntLE​(int index,
                                int value)
        Deprecated.
        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 AbstractByteBuf
      • _setIntLE

        protected void _setIntLE​(int index,
                                 int value)
        Deprecated.
        Specified by:
        _setIntLE in class AbstractByteBuf
      • setLong

        public ByteBuf setLong​(int index,
                               long value)
        Deprecated.
        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 AbstractByteBuf
      • _setLong

        protected void _setLong​(int index,
                                long value)
        Deprecated.
        Specified by:
        _setLong in class AbstractByteBuf
      • setLongLE

        public ByteBuf setLongLE​(int index,
                                 long value)
        Deprecated.
        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 AbstractByteBuf
      • _setLongLE

        protected void _setLongLE​(int index,
                                  long value)
        Deprecated.
        Specified by:
        _setLongLE in class AbstractByteBuf
      • setBytes

        public ByteBuf setBytes​(int index,
                                byte[] src,
                                int srcIndex,
                                int length)
        Deprecated.
        Description copied from class: ByteBuf
        Transfers the specified source array's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in class ByteBuf
      • setBytes

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

        public ByteBuf setBytes​(int index,
                                java.nio.ByteBuffer src)
        Deprecated.
        Description copied from class: ByteBuf
        Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in class ByteBuf
      • getBytes

        public ByteBuf getBytes​(int index,
                                java.io.OutputStream out,
                                int length)
                         throws java.io.IOException
        Deprecated.
        Description copied from class: ByteBuf
        Transfers this buffer's data to the specified stream starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        getBytes in class ByteBuf
        length - the number of bytes to transfer
        Throws:
        java.io.IOException - if the specified stream threw an exception during I/O
      • getBytes

        public int getBytes​(int index,
                            java.nio.channels.GatheringByteChannel out,
                            int length)
                     throws java.io.IOException
        Deprecated.
        Description copied from class: ByteBuf
        Transfers this buffer's data to the specified channel starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        getBytes in class ByteBuf
        length - the maximum number of bytes to transfer
        Returns:
        the actual number of bytes written out to the specified channel
        Throws:
        java.io.IOException - if the specified channel threw an exception during I/O
      • getBytes

        public int getBytes​(int index,
                            java.nio.channels.FileChannel out,
                            long position,
                            int length)
                     throws java.io.IOException
        Deprecated.
        Description copied from class: ByteBuf
        Transfers this buffer's data starting at the specified absolute index to the specified channel starting at the given file position. This method does not modify readerIndex or writerIndex of this buffer. This method does not modify the channel's position.
        Specified by:
        getBytes in class ByteBuf
        position - the file position at which the transfer is to begin
        length - the maximum number of bytes to transfer
        Returns:
        the actual number of bytes written out to the specified channel
        Throws:
        java.io.IOException - if the specified channel threw an exception during I/O
      • setBytes

        public int setBytes​(int index,
                            java.io.InputStream in,
                            int length)
                     throws java.io.IOException
        Deprecated.
        Description copied from class: ByteBuf
        Transfers the content of the specified source stream to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in class ByteBuf
        length - the number of bytes to transfer
        Returns:
        the actual number of bytes read in from the specified channel. -1 if the specified InputStream reached EOF.
        Throws:
        java.io.IOException - if the specified stream threw an exception during I/O
      • setBytes

        public int setBytes​(int index,
                            java.nio.channels.ScatteringByteChannel in,
                            int length)
                     throws java.io.IOException
        Deprecated.
        Description copied from class: ByteBuf
        Transfers the content of the specified source channel to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in class ByteBuf
        length - the maximum number of bytes to transfer
        Returns:
        the actual number of bytes read in from the specified channel. -1 if the specified channel is closed or it reached EOF.
        Throws:
        java.io.IOException - if the specified channel threw an exception during I/O
      • setBytes

        public int setBytes​(int index,
                            java.nio.channels.FileChannel in,
                            long position,
                            int length)
                     throws java.io.IOException
        Deprecated.
        Description copied from class: ByteBuf
        Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer. This method does not modify the channel's position.
        Specified by:
        setBytes in class ByteBuf
        position - the file position at which the transfer is to begin
        length - the maximum number of bytes to transfer
        Returns:
        the actual number of bytes read in from the specified channel. -1 if the specified channel is closed or it reached EOF.
        Throws:
        java.io.IOException - if the specified channel threw an exception during I/O
      • nioBuffers

        public java.nio.ByteBuffer[] nioBuffers​(int index,
                                                int length)
        Deprecated.
        Description copied from class: ByteBuf
        Exposes this buffer's bytes as an NIO 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. This method does not modify readerIndex or writerIndex of this buffer. Please note that the returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic buffer and it adjusted its capacity.
        Specified by:
        nioBuffers in class ByteBuf
        See Also:
        ByteBuf.nioBufferCount(), ByteBuf.nioBuffer(), ByteBuf.nioBuffer(int, int)
      • forEachByte

        public int forEachByte​(int index,
                               int length,
                               ByteProcessor processor)
        Deprecated.
        Description copied from class: ByteBuf
        Iterates over the specified area of this buffer with the specified processor in ascending order. (i.e. index, (index + 1), .. (index + length - 1))
        Overrides:
        forEachByte in class AbstractByteBuf
        Returns:
        -1 if the processor iterated to or beyond the end of the specified area. The last-visited index If the ByteProcessor.process(byte) returned false.
      • forEachByteDesc

        public int forEachByteDesc​(int index,
                                   int length,
                                   ByteProcessor processor)
        Deprecated.
        Description copied from class: ByteBuf
        Iterates over the specified area of this buffer with the specified processor in descending order. (i.e. (index + length - 1), (index + length - 2), ... index)
        Overrides:
        forEachByteDesc in class AbstractByteBuf
        Returns:
        -1 if the processor iterated to or beyond the beginning of the specified area. The last-visited index If the ByteProcessor.process(byte) returned false.