public final class BitInputStream extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_CAPACITY |
| Constructor and Description |
|---|
BitInputStream(InputStream istream)
Construct an instance of this class from an input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
align()
Discard any bits currently in the buffer to byte-align stream
|
int |
lookAhead()
Returns current byte buffer without actually reading data
|
int |
read()
Reads one byte (8 bits) of data from the input stream
|
void |
read(byte[] b,
int off,
int len) |
int |
readBit()
Return next bit from underlying stream.
|
int |
readBits(int n)
Read the next n bits and return the result as an integer.
|
void |
setInputStream(InputStream istream)
Resets this instance and sets a new underlying input stream.
|
void |
skip(long n)
Skip n bytes
|
public static final int BUFFER_CAPACITY
public BitInputStream(InputStream istream)
istream - input streampublic void setInputStream(InputStream istream)
istream - input streampublic void align()
throws IOException
IOException - IO exceptionpublic int lookAhead()
throws IOException
IOException - IO exceptionpublic void skip(long n)
throws IOException
n - bytesIOException - IO exceptionpublic int readBit()
throws IOException
IOException - IO exceptionpublic int readBits(int n)
throws IOException
n - The number of bits in the range [1,32].IOException - IO exceptionpublic final int read()
throws IOException
IOException - IO exceptionpublic void read(byte[] b,
int off,
int len)
throws IOException
IOExceptionCopyright © 2018 Siemens AG. All rights reserved.