|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkorat.utils.io.BitRandomAccessFile
public class BitRandomAccessFile
Utility for reading bits from the random access file.
| Field Summary | |
|---|---|
private RandomAccessFile |
file
|
private int |
inBuff
|
private int |
inBuffSize
|
private static long[] |
MASKS
|
| Constructor Summary | |
|---|---|
BitRandomAccessFile(String fileName)
|
|
| Method Summary | |
|---|---|
void |
close()
|
long |
getFilePointer()
Get file pointer in bits |
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. |
void |
seek(long numBits)
Positions file pointer to the given location. |
| 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 RandomAccessFile file
private int inBuff
private int inBuffSize
| Constructor Detail |
|---|
public BitRandomAccessFile(String fileName)
throws FileNotFoundException
FileNotFoundException| Method Detail |
|---|
public long readBitsAsLong(int numOfBits)
throws IOException
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 void seek(long numBits)
throws IOException
numBits -
IOException
public int readBitsAsInt(int numOfBits)
throws IOException
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.
public long getFilePointer()
throws IOException
IOException
public void close()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||