Class WritableBuffer

    • Constructor Summary

      Constructors 
      Constructor Description
      WritableBuffer()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void writeByte​(boolean value)
      Write boolean to the buffer.
      abstract void writeByte​(byte value)
      Write a byte to the buffer.
      void writeByte​(int value)
      Write a int to the buffer, the int is casted to a byte;
      abstract void writeBytes​(byte... value)
      Write byte[] to the buffer.
      abstract void writeChar​(char value)
      Write char to the buffer.
      16 bit char
      abstract void writeDouble​(double value)
      Write double to the buffer.
      abstract void writeFloat​(float value)
      Write float to the buffer.
      void writeInt​(boolean value)
      Write boolean to the buffer.
      abstract void writeInt​(int value)
      Write int to the buffer.
      abstract void writeLong​(long value)
      Write long to the buffer.
      void writeShort​(boolean value)
      Write boolean to the buffer.
      void writeShort​(int value)
      Write short to the buffer.
      abstract void writeShort​(short value)
      Write short to the buffer.
      void writeSizedString​(java.lang.CharSequence text)
      Write String to the buffer preceded by a short 16 bit with String length and no null termination.
      void writeString​(java.lang.CharSequence text)
      Write a String to the buffer with a null termination (\000).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WritableBuffer

        public WritableBuffer()
    • Method Detail

      • writeByte

        public abstract void writeByte​(byte value)
        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%
        Parameters:
        value - to be written
      • writeByte

        public void writeByte​(int value)
        Write a int to the buffer, the int is casted to a byte;
        Parameters:
        value - to be written
      • writeByte

        public void writeByte​(boolean value)
        Write boolean to the buffer.
        If the value is true so write a byte with value 1, otherwise 0 8bit integer (00)
        Parameters:
        value - to be written
      • writeBytes

        public abstract void writeBytes​(byte... value)
        Write byte[] to the buffer.
        8bit integer array (00 ...)
        Parameters:
        value - to be written
      • writeShort

        public abstract void writeShort​(short value)
        Write short to the buffer.
        16bit integer (00 00)
        Parameters:
        value - to be written
      • writeShort

        public void writeShort​(int value)
        Write short to the buffer.
        16bit integer (00 00)
        Parameters:
        value - to be written
      • writeShort

        public void writeShort​(boolean value)
        Write boolean to the buffer.
        If the value is true so write a byte with value 1, otherwise 0 16bit integer (00 00)
        Parameters:
        value - to be written
      • writeChar

        public abstract void writeChar​(char value)
        Write char to the buffer.
        16 bit char
        Parameters:
        value - the char to be put on data.
      • writeInt

        public abstract void writeInt​(int value)
        Write int to the buffer.
        32bit integer (00 00 00 00)
        Parameters:
        value - to be written
      • writeInt

        public void writeInt​(boolean value)
        Write boolean to the buffer.
        If the value is true so write a byte with value 1, otherwise 0 32bit integer (00 00 00 00)
        Parameters:
        value - to be written
      • writeFloat

        public abstract void writeFloat​(float value)
        Write float to the buffer.
        32bit float point number (00 00 00 00)
        Parameters:
        value - to be written
      • writeLong

        public abstract void writeLong​(long value)
        Write long to the buffer.
        64bit integer (00 00 00 00 00 00 00 00)
        Parameters:
        value - to be written
      • writeDouble

        public abstract void writeDouble​(double value)
        Write double to the buffer.
        64bit double precision float (00 00 00 00 00 00 00 00)
        Parameters:
        value - to be written
      • writeString

        public void writeString​(java.lang.CharSequence text)
        Write a String to the buffer with a null termination (\000). Each character is a 16bit char
        Parameters:
        text - to be written
      • writeSizedString

        public void writeSizedString​(java.lang.CharSequence text)
        Write String to the buffer preceded by a short 16 bit with String length and no null termination. Each character is a 16bit char.
        Parameters:
        text - to be written