public class BitShiftedInputStream extends FilterInputStream
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentBitPosition
The current bit position in the underlying input stream.
|
protected int |
currentValue
The current value from the underlying input stream.
|
protected int |
valueSize
The number of bits per value.
|
in| Constructor and Description |
|---|
BitShiftedInputStream(InputStream in,
int valueSize)
Creates a new bit-shifted input stream wrapped around the specified input
stream with the specified value size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
read()
Reads a value from the underlying input stream.
|
int |
read(int valueSize)
Reads a value with the given number of bits from the underlying input
stream.
|
void |
skipBits(int numberOfBits)
Skips the specified number of bits.
|
available, close, mark, markSupported, read, read, reset, skipprotected int valueSize
protected int currentBitPosition
protected int currentValue
public BitShiftedInputStream(InputStream in, int valueSize)
in - The input stream to wrapvalueSize - The number of bits per valuepublic int read()
throws IOException
read in class FilterInputStreamIOException - if an I/O error occurspublic int read(int valueSize)
throws IOException
valueSize - The number of bits to readIOException - if an I/O error occurspublic void skipBits(int numberOfBits)
throws IOException
numberOfBits - The number of bits to skipIOException - if an I/O error occursCopyright © 2026. All rights reserved.