public class BitReader extends Object
Constructor and Description |
---|
BitReader(RandomAccessFile raf,
long startPos)
Constructor
|
Modifier and Type | Method and Description |
---|---|
long |
bits2UInt(int nb)
Read the next nb bits and return an Unsigned Long .
|
long |
getPos() |
void |
incrByte()
Go to the next byte in the stream
|
static void |
main(String[] args) |
void |
setBitOffset(int bitOffset)
Position file at bitOffset from startPos
|
public BitReader(RandomAccessFile raf, long startPos) throws IOException
raf
- the RandomAccessFilestartPos
- points to start of data in data section, in bytesIOException
- on read errorpublic void incrByte()
public void setBitOffset(int bitOffset) throws IOException
bitOffset
- bit offset from starting positionIOException
- on io errorpublic long bits2UInt(int nb) throws IOException
nb
- the number of bits to convert to int, must be <= 64.IOException
- on read errorpublic long getPos() throws IOException
IOException
public static void main(String[] args) throws IOException
IOException
Copyright © 1999–2014 UCAR/Unidata. All rights reserved.