Class DynamicPacketBuffer

    • Constructor Detail

      • DynamicPacketBuffer

        public DynamicPacketBuffer​(java.nio.ByteBuffer buffer,
                                   ResourcePool resourcePool)
    • Method Detail

      • writeByte

        public void writeByte​(byte value)
        Description copied from class: WritableBuffer
        Write a byte to the buffer.
        8bit integer (00) If the underlying data array can't hold a new byte its size is increased 20%
        Specified by:
        writeByte in class WritableBuffer
        Parameters:
        value - to be written
      • writeByte

        public void writeByte​(int index,
                              byte value)
        Description copied from interface: Buffer
        Write byte to the buffer at index.
        8bit integer (00)
        Parameters:
        index - index to write to
        value - to be written
      • writeBytes

        public void writeBytes​(byte[] bytes)
        Description copied from class: WritableBuffer
        Write byte[] to the buffer.
        8bit integer array (00 ...)
        Specified by:
        writeBytes in class WritableBuffer
        Parameters:
        bytes - to be written
      • writeShort

        public void writeShort​(short value)
        Description copied from class: WritableBuffer
        Write short to the buffer.
        16bit integer (00 00)
        Specified by:
        writeShort in class WritableBuffer
        Parameters:
        value - to be written
      • writeShort

        public void writeShort​(int index,
                               short value)
        Description copied from interface: Buffer
        Write int to the buffer at index.
        16bit integer (00 00)
        Parameters:
        index - index to write to
        value - to be written
      • writeChar

        public void writeChar​(char value)
        Description copied from class: WritableBuffer
        Write char to the buffer.
        16 bit char
        Specified by:
        writeChar in class WritableBuffer
        Parameters:
        value - the char to be put on data.
      • writeInt

        public void writeInt​(int value)
        Description copied from class: WritableBuffer
        Write int to the buffer.
        32bit integer (00 00 00 00)
        Specified by:
        writeInt in class WritableBuffer
        Parameters:
        value - to be written
      • writeInt

        public void writeInt​(int index,
                             int value)
        Description copied from interface: Buffer
        Write int to the buffer at index.
        32bit integer (00 00 00 00)
        Parameters:
        index - index to write to
        value - to be written
      • writeFloat

        public void writeFloat​(float value)
        Description copied from class: WritableBuffer
        Write float to the buffer.
        32bit float point number (00 00 00 00)
        Specified by:
        writeFloat in class WritableBuffer
        Parameters:
        value - to be written
      • writeLong

        public void writeLong​(long value)
        Description copied from class: WritableBuffer
        Write long to the buffer.
        64bit integer (00 00 00 00 00 00 00 00)
        Specified by:
        writeLong in class WritableBuffer
        Parameters:
        value - to be written
      • writeDouble

        public void writeDouble​(double value)
        Description copied from class: WritableBuffer
        Write double to the buffer.
        64bit double precision float (00 00 00 00 00 00 00 00)
        Specified by:
        writeDouble in class WritableBuffer
        Parameters:
        value - to be written
      • readByte

        public byte readByte​(int index)
        Description copied from interface: Buffer
        Read byte from the buffer at index.
        8bit integer (00)
        Parameters:
        index - index to read from
        Returns:
        the byte value at the index.
      • readBytes

        public void readBytes​(int index,
                              byte[] data)
      • readShort

        public short readShort​(int index)
        Description copied from interface: Buffer
        Read short from the buffer at index.
        16bit integer (00 00)
        Parameters:
        index - index to read from
        Returns:
        the short value at index.
      • readInt

        public int readInt​(int index)
        Description copied from interface: Buffer
        Read int from the buffer at index.
        32bit integer (00 00 00 00)
        Parameters:
        index - index to read from
        Returns:
        the int value at index.
      • readFloat

        public float readFloat​(int index)
      • readLong

        public long readLong​(int index)
      • readDouble

        public double readDouble​(int index)
      • limit

        public int limit()
        Returns:
        the buffer's limit
      • limit

        public void limit​(int newLimit)
        Description copied from interface: Buffer
        Change the buffer's limit
        Parameters:
        newLimit - the new limit
      • capacity

        public int capacity()