|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.compression.BitFileBuffered.BitInBuffered
protected static class BitFileBuffered.BitInBuffered
Implements a BitIn around a RandomDataInput
| Field Summary | |
|---|---|
protected int |
bitOffset
bit offset in this byte, and in the larger file |
protected byte[] |
inBuffer
buffer for the slice of the file being read |
protected long |
offset
ofset in the larger file |
protected RandomDataInput |
parentFile
parent file |
protected int |
readByteOffset
byte offset within the buffer |
protected int |
size
size of the buffer |
| Fields inherited from interface org.terrier.compression.BitIn |
|---|
USUAL_EXTENSION |
| Constructor Summary | |
|---|---|
protected |
BitFileBuffered.BitInBuffered()
empty constructor for child classes |
|
BitFileBuffered.BitInBuffered(RandomDataInput file,
long startByteOffset,
byte _bitOffset,
int _bufLength)
Construct a new BitInBuffered on the specified file, starting at the given offset and with the specified buffer length. |
| Method Summary | |
|---|---|
void |
align()
Aligns the stream to the next byte |
void |
close()
Does nothing |
byte |
getBitOffset()
Returns the bit offset in the last byte. |
long |
getByteOffset()
Returns the byte offset of the stream. |
protected void |
incrByte()
Move forward one byte |
protected void |
incrByte(int i)
Move forward i bytes |
int |
readBinary(int len)
Reads a binary integer from the already read buffer. |
int |
readDelta()
Reads a delta encoded integer from the underlying stream |
int |
readGamma()
Reads a gamma encoded integer from the underlying stream |
int |
readGolomb(int b)
Reads a Golomb encoded integer |
protected void |
readIn()
Reads a new byte from the InputStream if we have finished with the current one. |
void |
readInterpolativeCoding(int[] data,
int localoffset,
int len,
int lo,
int hi)
Reads a sequence of numbers from the stream interpolative coded. |
int |
readMinimalBinary(int b)
Reads a binary encoded integer, given an upper bound |
int |
readMinimalBinaryZero(int b)
Reads a minimal binary encoded number, when the upper bound can b zero. |
int |
readSkewedGolomb(int b)
Reads a skewed-golomb encoded integer from the underlying stream Consider a bucket-vector v = <0, 2b, 4b, ... |
int |
readUnary()
Reads a unary encoded integer from the underlying stream |
void |
skipBits(int len)
Skip a number of bits in the current input stream |
void |
skipBytes(long len)
Skip a number of bytes while reading the bit file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RandomDataInput parentFile
protected long offset
protected byte[] inBuffer
protected int size
protected int readByteOffset
protected int bitOffset
| Constructor Detail |
|---|
protected BitFileBuffered.BitInBuffered()
public BitFileBuffered.BitInBuffered(RandomDataInput file,
long startByteOffset,
byte _bitOffset,
int _bufLength)
file - File to seek onstartByteOffset - Start byte offset_bitOffset - Start bit offset_bufLength - Number of bytes to buffer| Method Detail |
|---|
protected void incrByte()
protected void incrByte(int i)
public int readDelta()
throws java.io.IOException
readDelta in interface BitInjava.io.IOException - if an I/O error occurspublic int readGamma()
readGamma in interface BitIn
public int readSkewedGolomb(int b)
throws java.io.IOException
v = <0, 2b, 4b, ... , 2^i b, ...>
The sum of the elements in the vector goes
b, 3b, 7b, 2^(i-1)*b
readSkewedGolomb in interface BitInjava.io.IOException - if an I/O error occurs
public void readInterpolativeCoding(int[] data,
int localoffset,
int len,
int lo,
int hi)
throws java.io.IOException
readInterpolativeCoding in interface BitIndata - the result vectorlocaloffset - offset where to write in the vectorlen - the number of integers to decode.lo - a lower bound (the same one passed to writeInterpolativeCoding)hi - an upper bound (the same one passed to writeInterpolativeCoding)
java.io.IOException - if an I/O error occurspublic int readUnary()
readUnary in interface BitIn
public int readGolomb(int b)
throws java.io.IOException
readGolomb in interface BitInb - the golomb modulus
java.io.IOException - if and I/O error occurs
public int readMinimalBinary(int b)
throws java.io.IOException
readMinimalBinary in interface BitInb - the upper bound
java.io.IOException - if an I/O error occurs
public int readMinimalBinaryZero(int b)
throws java.io.IOException
readMinimalBinaryZero in interface BitInb - the upper bound
java.io.IOException - if an I/O error occursprotected void readIn()
public void align()
align in interface BitInpublic int readBinary(int len)
readBinary in interface BitInlen - the number of binary bits to read
public void skipBits(int len)
skipBits in interface BitInlen - The number of bits to skip
public void skipBytes(long len)
throws java.io.IOException
skipBytes in interface BitInlen - The number of bytes to skip
java.io.IOException - if an I/O error occurspublic long getByteOffset()
getByteOffset in interface BitInpublic byte getBitOffset()
getBitOffset in interface BitInpublic void close()
close in interface java.io.Closeable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||