|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
korat.utils.io.BitInputStream
public class BitInputStream
Utility for reading bits from underlying InputStream.
| Field Summary | |
|---|---|
private int |
buff
|
private int |
buffSize
|
private static long[] |
MASKS
|
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
BitInputStream(InputStream in)
|
|
| Method Summary | |
|---|---|
int |
readBitsAsInt(int numOfBits)
Reads the given number of bits and interprets them as int. |
long |
readBitsAsLong(int numOfBits)
Reads the given number of bits and interprets them as long |
double |
readDouble()
Reads 64 bits and interprets them as double. |
float |
readFloat()
Reads 32 bits and interprets them as float. |
int |
readInt()
Reads 32 bits and interprets them as int. |
long |
readLong()
Reads 64 bits and interprets them as long. |
| Methods inherited from class java.io.FilterInputStream |
|---|
available, close, mark, markSupported, read, read, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long[] MASKS
private int buff
private int buffSize
| Constructor Detail |
|---|
public BitInputStream(InputStream in)
in - As per the general contract of the
FilterInputStream.| Method Detail |
|---|
public long readBitsAsLong(int numOfBits)
throws IOException
IBitReader
readBitsAsLong in interface IBitReadernumOfBits - number of bits to read. Has to be in the range from 1 to 64.
IOException - if an I/O error occurs.
public int readBitsAsInt(int numOfBits)
throws IOException
IBitReader
readBitsAsInt in interface IBitReadernumOfBits - number of bits to read. Has to be in the range from 1 to 31.
IOException - if an I/O error occurs.
public int readInt()
throws IOException
IBitReader
readInt in interface IBitReaderIOException - if an I/O error occurs.
public long readLong()
throws IOException
IBitReader
readLong in interface IBitReaderIOException - if an I/O error occurs.
public float readFloat()
throws IOException
IBitReader
readFloat in interface IBitReaderIOException - if an I/O error occurs.
public double readDouble()
throws IOException
IBitReader
readDouble in interface IBitReaderIOException - if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||