com.aspose.note.infrastructure

Class BitReader



  • public class BitReader
    extends Object

    Reads primitive data types as bit values.

    • Constructor Summary

      Constructors 
      Constructor and Description
      BitReader(byte val)
      Initializes a new instance of the BitReader class.
      BitReader(byte[] bytes)
      Initializes a new instance of the BitReader class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean read()
      Reads one bit from current stream and advance the current position.
      com.aspose.ms.System.Collections.BitArray readBits(int count)
      Reads a byte as count of bits from the current stream and advances the current position of the stream by count bits.
      boolean readBoolean()
      Reads a Boolean value from the current stream and advances the current position of the stream by one bit.
      byte readByte()
      Reads a byte from the current stream and advances the current position of the stream by count bits.
      byte readByte(int count)
      Reads a byte as count of bits from the current stream and advances the current position of the stream by count bits.
      byte[] readBytes(int count)
      Reads a bytes by count from the current stream and advances the current position of the stream by count bits.
      float readFloat()
      Reads four bits from current stream and advance the current position.
      long readUInt(int count)
      Reads a unsigned integer as count of bits from the current stream and advances the current position of the stream by count bits.
      int readUInt16()
      Reads a unsigned integer as 16 of bits from the current stream and advances the current position of the stream by count bits.
      int seek(int offset)
      Sets the position from beginning
    • Constructor Detail

      • BitReader

        public BitReader(byte val)

        Initializes a new instance of the BitReader class.

        Parameters:
        val - The byte value.
      • BitReader

        public BitReader(byte[] bytes)

        Initializes a new instance of the BitReader class.

        Parameters:
        bytes - The byte array value.
    • Method Detail

      • read

        public boolean read()

        Reads one bit from current stream and advance the current position.

        Returns:
        The one bit.
      • readFloat

        public float readFloat()

        Reads four bits from current stream and advance the current position.

        Returns:
        one bit
      • readUInt

        public long readUInt(int count)

        Reads a unsigned integer as count of bits from the current stream and advances the current position of the stream by count bits.

        Parameters:
        count - The count of bits.
        Returns:
        value base on bits count
      • readUInt16

        public int readUInt16()

        Reads a unsigned integer as 16 of bits from the current stream and advances the current position of the stream by count bits.

        Returns:
        value base on bits count
      • readBoolean

        public boolean readBoolean()

        Reads a Boolean value from the current stream and advances the current position of the stream by one bit.

        Returns:
        THe value of one bit
      • readByte

        public byte readByte()

        Reads a byte from the current stream and advances the current position of the stream by count bits.

        Returns:
        The value base on bits count
      • readByte

        public byte readByte(int count)

        Reads a byte as count of bits from the current stream and advances the current position of the stream by count bits.

        Parameters:
        count - The count of bits.
        Returns:
        value base on bits count
      • readBytes

        public byte[] readBytes(int count)

        Reads a bytes by count from the current stream and advances the current position of the stream by count bits.

        Parameters:
        count - The count of bits.
        Returns:
        The byte array.
      • readBits

        public com.aspose.ms.System.Collections.BitArray readBits(int count)

        Reads a byte as count of bits from the current stream and advances the current position of the stream by count bits.

        Parameters:
        count - The count of bits.
        Returns:
        The bit array.
      • seek

        public int seek(int offset)

        Sets the position from beginning

        Parameters:
        offset - A bits offset relative to the origin parameter.
        Returns:
        The integra value.