Package eu.bandm.tools.util
Class BitInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
eu.bandm.tools.util.BitInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Intput Stream which allows to read single bits sequentially.
Bits have been written by
BitOutputStream
, i.e. left aligned.
For details see there.
Mark and reset as documented from the superclass are supported.-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invalidate the bit buffer whenever a primitive type (made of whole bytes( is read.void
mark
(int readlimit) Additionally the current state of the bit buffer and bit index are saved.int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) int
readBit()
Reads one bit value from the packed data stream.void
reset()
Additionally the current state of the bit buffer and bit index are restored.Methods inherited from class java.io.FilterInputStream
available, close, markSupported, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
BitInputStream
Only constructed. Sets the source of the read operations.
-
-
Method Details
-
readBit
Reads one bit value from the packed data stream.- Throws:
IOException
-
byteAlign
public void byteAlign()Invalidate the bit buffer whenever a primitive type (made of whole bytes( is read. -
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) Additionally the current state of the bit buffer and bit index are saved.- Overrides:
mark
in classFilterInputStream
-
reset
Additionally the current state of the bit buffer and bit index are restored.- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-