Class BitInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    class BitInputStream
    extends java.io.InputStream
    Input stream reading 1-8, 16, 24 or 32 bits, starting from the most significant bit, but incapable of reading non-aligned and < 8 bit fields across byte boundaries.
    • Constructor Summary

      Constructors 
      Constructor Description
      BitInputStream​(java.io.InputStream is, java.nio.ByteOrder byteOrder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flushCache()  
      long getBytesRead()  
      int read()  
      int readBits​(int count)  
      • Methods inherited from class java.io.InputStream

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

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

      • is

        private final java.io.InputStream is
      • byteOrder

        private final java.nio.ByteOrder byteOrder
      • cache

        private int cache
      • cacheBitsRemaining

        private int cacheBitsRemaining
      • bytesRead

        private long bytesRead
    • Constructor Detail

      • BitInputStream

        BitInputStream​(java.io.InputStream is,
                       java.nio.ByteOrder byteOrder)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • readBits

        public final int readBits​(int count)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • flushCache

        public void flushCache()
      • getBytesRead

        public long getBytesRead()