|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream net.sourceforge.jgrib.BitInputStream
public class BitInputStream
This class is an input stream wrapper that can read a specific number of bytes and bits from an input stream.
Field Summary | |
---|---|
protected int |
bitBuf
Buffer for one byte which will be processed bit by bit. |
protected int |
bitPos
Current bit position in bitBuf. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
BitInputStream(java.io.InputStream in)
Constructs a bit input stream from an InputStream object. |
Method Summary | |
---|---|
byte[] |
read(int length)
Read specific number of bytes from the input stream. |
int |
readSBits(int numBits)
Read a signed value from the given number of bits |
long |
readUBits(int numBits)
Read an unsigned value from the given number of bits. |
int |
readUI8()
Read an unsigned 8 bit value. |
int[] |
readUI8(int length)
Read specific number of unsigned bytes from the input stream. |
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 |
---|
protected int bitBuf
protected int bitPos
Constructor Detail |
---|
public BitInputStream(java.io.InputStream in)
in
- input stream that will be wrappedMethod Detail |
---|
public int readUI8() throws java.io.IOException
java.io.IOException
public int[] readUI8(int length) throws java.io.IOException
length
- number of bytes to read and return as integers
java.io.IOException
public byte[] read(int length) throws java.io.IOException
length
- number of bytes to read
java.io.IOException
public long readUBits(int numBits) throws java.io.IOException
numBits
- number of bits used for the unsigned value
java.io.IOException
public int readSBits(int numBits) throws java.io.IOException
numBits
- number of bits used for the signed value
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |