public class BitReader extends Object
Constructor and Description |
---|
BitReader(byte[] array,
int index)
Initializes a new instance of the BitReader class with specified bytes buffer and start position in byte.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Assign the internal read buffer to null.
|
boolean |
getCurrent() |
boolean |
moveNext()
Advances the enumerator to the next bit of the byte array.
|
byte[] |
readBytes(int readingLength)
Reading the bytes specified by the byte length.
|
UUID |
readGuid()
Read as a GUID from the current offset position and increate the bit offset with 128 bit.
|
short |
readInt16(int readingLength)
Read specified bit length content as an UInt16 type and increase the bit offset with the specified length.
|
int |
readInt32(int readingLength)
Read specified bit length content as an Int32 type and increase the bit offset with the specified length.
|
int |
readUInt16(int readingLength) |
int |
readUInt32(int readingLength)
Read specified bit length content as an UInt32 type and increase the bit offset with the specified length.
|
long |
readUInt64(int readingLength)
Read specified bit length content as an UInt64 type and increase the bit offset.
|
void |
reset()
Sets the enumerator to its initial position, which is before the first bit in the byte array.
|
public BitReader(byte[] array, int index)
array
- Specify the byte array which contains the bytes need to be read.index
- Specify the start position in byte.public boolean getCurrent()
public long readUInt64(int readingLength) throws IOException
readingLength
- Specify the reading bit length.IOException
public int readUInt32(int readingLength) throws IOException
readingLength
- Specify the reading bit length.IOException
public int readUInt16(int readingLength) throws IOException
IOException
public byte[] readBytes(int readingLength) throws IOException
readingLength
- Specify the reading byte length.IOException
public short readInt16(int readingLength) throws IOException
readingLength
- Specify the reading bit length.IOException
public int readInt32(int readingLength) throws IOException
readingLength
- Specify the reading bit length.IOException
public UUID readGuid() throws IOException
IOException
public boolean moveNext()
public void dispose()
public void reset()
Copyright © 2007–2023 The Apache Software Foundation. All rights reserved.