Class BitWriter


  • public class BitWriter
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      BitWriter​(int bufferSize)
      Initializes a new instance of the BitWriter class with specified buffer size in byte.
    • Constructor Detail

      • BitWriter

        public BitWriter​(int bufferSize)
        Initializes a new instance of the BitWriter class with specified buffer size in byte.
        Parameters:
        bufferSize - Specify the buffer byte size.
    • Method Detail

      • getBytes

        public byte[] getBytes()
                        throws IOException
        Gets a copy byte array which contains the current written byte.
        Throws:
        IOException
      • appendUInt64

        public void appendUInt64​(long value,
                                 int length)
        Append a specified Unit64 type value into the buffer with the specified bit length.
        Parameters:
        value - Specify the value which needs to be appended.
        length - Specify the bit length which the value will occupy in the buffer.
      • appendUInit32

        public void appendUInit32​(int value,
                                  int length)
        Append a specified Unit32 type value into the buffer with the specified bit length.
        Parameters:
        value - Specify the value which needs to be appended.
        length - Specify the bit length which the value will occupy in the buffer.
      • appendInit32

        public void appendInit32​(int value,
                                 int length)
        Append a specified Init32 type value into the buffer with the specified bit length.
        Parameters:
        value - Specify the value which needs to be appended.
        length - Specify the bit length which the value will occupy in the buffer.
      • appendGUID

        public void appendGUID​(UUID value)
        Append a specified GUID value into the buffer.
        Parameters:
        value - Specify the GUID value.