Documentation of 'org.freehep.util.io.BitInputStream' Java class
BitInputStream
org.freehep.util.io

Class BitInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    ByteOrderInputStream


    public class BitInputStream
    extends DecompressableInputStream
    Class to read bits from a Stream, allowing for byte synchronization. Signed, Unsigned, Booleans and Floats can be read.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BitInputStream(java.io.InputStream in)
      Create a Bit input stream from viven input
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void byteAlign()
      A utility to force the next read to be byte-aligned.
      boolean readBitFlag()
      Read a bit from the input stream and interpret this as a boolean value.
      float readFBits(int n)
      Read a float value of n-bits from the stream.
      long readSBits(int n)
      Read a signed value of n-bits from the input stream.
      long readUBits(int n)
      Read an unsigned value of n-bits from the input stream.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, read, read, reset
      • Methods inherited from class java.lang.Object

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

      • BitInputStream

        public BitInputStream(java.io.InputStream in)
        Create a Bit input stream from viven input
        Parameters:
        in - stream to read from
    • Method Detail

      • byteAlign

        public void byteAlign()
        A utility to force the next read to be byte-aligned.
      • readBitFlag

        public boolean readBitFlag()
                            throws java.io.IOException
        Read a bit from the input stream and interpret this as a boolean value. A 1-bit is true; a 0-bit is false.
        Returns:
        true if read bit was 1
        Throws:
        java.io.IOException - if read fails
      • readSBits

        public long readSBits(int n)
                       throws java.io.IOException
        Read a signed value of n-bits from the input stream.
        Parameters:
        n - number of bits to read
        Returns:
        value made up of read bits
        Throws:
        java.io.IOException - if read fails
      • readFBits

        public float readFBits(int n)
                        throws java.io.IOException
        Read a float value of n-bits from the stream.
        Parameters:
        n - number of bits to read
        Returns:
        value made up of read bits
        Throws:
        java.io.IOException - if read fails
      • readUBits

        public long readUBits(int n)
                       throws java.io.IOException
        Read an unsigned value of n-bits from the input stream.
        Parameters:
        n - number of bits to read
        Returns:
        value made up of read bits
        Throws:
        java.io.IOException - if read fails

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.