Package org.terrier.compression.bit
Class BitFileBuffered.BitInBuffered
- java.lang.Object
-
- org.terrier.compression.bit.BitInBase
-
- org.terrier.compression.bit.BitFileBuffered.BitInBuffered
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,BitIn
- Direct Known Subclasses:
BitFileChannel.FileChannelBitInBuffered,ConcurrentBitFileBuffered.ConcurrentBitInBuffered
- Enclosing class:
- BitFileBuffered
protected static class BitFileBuffered.BitInBuffered extends BitInBase
Implements a BitIn around a RandomDataInput
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]inBufferbuffer for the slice of the file being readprotected RandomDataInputparentFileparent fileprotected intreadByteOffsetbyte offset within the bufferprotected intsizesize of the buffer-
Fields inherited from interface org.terrier.compression.bit.BitIn
USUAL_EXTENSION
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBitInBuffered()empty constructor for child classesBitInBuffered(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Does nothingprotected voidincrByte()Move forward one byteprotected voidincrByte(int i)Move forward i bytesvoidskipBytes(long len)Skip a number of bytes while reading the bit file.-
Methods inherited from class org.terrier.compression.bit.BitInBase
align, getBitOffset, getByteOffset, readBinary, readDelta, readGamma, readGolomb, readIn, readInterpolativeCoding, readMinimalBinary, readMinimalBinaryZero, readSkewedGolomb, readUnary, skipBits
-
-
-
-
Field Detail
-
parentFile
protected RandomDataInput parentFile
parent file
-
inBuffer
protected byte[] inBuffer
buffer for the slice of the file being read
-
size
protected int size
size of the buffer
-
readByteOffset
protected int readByteOffset
byte offset within the buffer
-
-
Constructor Detail
-
BitInBuffered
protected BitInBuffered()
empty constructor for child classes
-
BitInBuffered
public 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.- Parameters:
file- File to seek onstartByteOffset- Start byte offset_bitOffset- Start bit offset_bufLength- Number of bytes to buffer
-
-
Method Detail
-
incrByte
protected void incrByte(int i)
Move forward i bytes
-
skipBytes
public void skipBytes(long len) throws java.io.IOExceptionSkip a number of bytes while reading the bit file. After this opteration, getBitOffset() == 0, so use skipBits(int) to get getBitOffset() to desired value.- Parameters:
len- The number of bytes to skip- Throws:
java.io.IOException- if an I/O error occurs
-
close
public void close()
Does nothing
-
-