Class BitReader
- java.lang.Object
- 
- org.apache.tika.parser.microsoft.onenote.fsshttpb.util.BitReader
 
- 
 public class BitReader extends Object A class is used to extract values across byte boundaries with arbitrary bit positions.
- 
- 
Constructor SummaryConstructors Constructor Description BitReader(byte[] array, int index)Initializes a new instance of the BitReader class with specified bytes buffer and start position in byte.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Assign the internal read buffer to null.booleangetCurrent()booleanmoveNext()Advances the enumerator to the next bit of the byte array.byte[]readBytes(int readingLength)Reading the bytes specified by the byte length.UUIDreadGuid()Read as a GUID from the current offset position and increate the bit offset with 128 bit.shortreadInt16(int readingLength)Read specified bit length content as an UInt16 type and increase the bit offset with the specified length.intreadInt32(int readingLength)Read specified bit length content as an Int32 type and increase the bit offset with the specified length.intreadUInt16(int readingLength)intreadUInt32(int readingLength)Read specified bit length content as an UInt32 type and increase the bit offset with the specified length.longreadUInt64(int readingLength)Read specified bit length content as an UInt64 type and increase the bit offset.voidreset()Sets the enumerator to its initial position, which is before the first bit in the byte array.
 
- 
- 
- 
Constructor Detail- 
BitReaderpublic BitReader(byte[] array, int index)Initializes a new instance of the BitReader class with specified bytes buffer and start position in byte.- Parameters:
- array- Specify the byte array which contains the bytes need to be read.
- index- Specify the start position in byte.
 
 
- 
 - 
Method Detail- 
getCurrentpublic boolean getCurrent() 
 - 
readUInt64public long readUInt64(int readingLength) throws IOExceptionRead specified bit length content as an UInt64 type and increase the bit offset.- Parameters:
- readingLength- Specify the reading bit length.
- Returns:
- Return the UInt64 type value.
- Throws:
- IOException
 
 - 
readUInt32public int readUInt32(int readingLength) throws IOExceptionRead specified bit length content as an UInt32 type and increase the bit offset with the specified length.- Parameters:
- readingLength- Specify the reading bit length.
- Returns:
- Return the UInt32 type value.
- Throws:
- IOException
 
 - 
readUInt16public int readUInt16(int readingLength) throws IOException- Throws:
- IOException
 
 - 
readBytespublic byte[] readBytes(int readingLength) throws IOExceptionReading the bytes specified by the byte length.- Parameters:
- readingLength- Specify the reading byte length.
- Returns:
- Return the read bytes array.
- Throws:
- IOException
 
 - 
readInt16public short readInt16(int readingLength) throws IOExceptionRead specified bit length content as an UInt16 type and increase the bit offset with the specified length.- Parameters:
- readingLength- Specify the reading bit length.
- Returns:
- Return the UInt16 value.
- Throws:
- IOException
 
 - 
readInt32public int readInt32(int readingLength) throws IOExceptionRead specified bit length content as an Int32 type and increase the bit offset with the specified length.- Parameters:
- readingLength- Specify the reading bit length.
- Returns:
- Return the Int32 type value.
- Throws:
- IOException
 
 - 
readGuidpublic UUID readGuid() throws IOException Read as a GUID from the current offset position and increate the bit offset with 128 bit.- Returns:
- Return the GUID value.
- Throws:
- IOException
 
 - 
moveNextpublic boolean moveNext() Advances the enumerator to the next bit of the byte array.- Returns:
- true if the enumerator was successfully advanced to the next bit; false if the enumerator has passed the end of the byte array.
 
 - 
disposepublic void dispose() Assign the internal read buffer to null.
 - 
resetpublic void reset() Sets the enumerator to its initial position, which is before the first bit in the byte array.
 
- 
 
-