Class BitInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.imaging.formats.tiff.datareaders.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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteOrder
byteOrder
private long
bytesRead
private int
cache
private int
cacheBitsRemaining
private java.io.InputStream
is
-
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)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.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()
-
-