public class BitInputStream extends DecompressableInputStream
| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
BIT_MASK |
protected static int[] |
FIELD_MASK |
protected static int |
MASK_SIZE |
protected static int |
ONES |
protected static int |
ZERO |
| Constructor and Description |
|---|
BitInputStream(InputStream in)
Create a Bit input stream from viven input
|
| Modifier and Type | Method and Description |
|---|---|
void |
byteAlign()
A utility to force the next read to be byte-aligned.
|
protected void |
fetchByte()
A utility method to fetch the next byte in preparation for constructing a
bit field.
|
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.
|
read, skip, startDecompressingreadavailable, close, mark, markSupported, read, resetprotected static final int MASK_SIZE
protected static final int ZERO
protected static final int ONES
protected static final int[] BIT_MASK
protected static final int[] FIELD_MASK
public BitInputStream(InputStream in)
in - stream to read fromprotected void fetchByte()
throws IOException
IOException - if read failspublic void byteAlign()
public boolean readBitFlag()
throws IOException
IOException - if read failspublic long readSBits(int n)
throws IOException
n - number of bits to readIOException - if read failspublic float readFBits(int n)
throws IOException
n - number of bits to readIOException - if read failspublic long readUBits(int n)
throws IOException
n - number of bits to readIOException - if read failsCopyright © 2016. All rights reserved.