public class BitReader extends Object
Reads primitive data types as bit values.
Constructor and Description |
---|
BitReader(byte val)
Initializes a new instance of the
BitReader class. |
BitReader(byte[] bytes)
Initializes a new instance of the
BitReader class. |
Modifier and Type | Method and Description |
---|---|
boolean |
read()
Reads one bit from current stream and advance the current position.
|
com.aspose.ms.System.Collections.BitArray |
readBits(int count)
Reads a byte as count of bits from the current stream and advances the current
position of the stream by count bits.
|
boolean |
readBoolean()
Reads a Boolean value from the current stream and advances the current position
of the stream by one bit.
|
byte |
readByte()
Reads a byte from the current stream and advances the current
position of the stream by count bits.
|
byte |
readByte(int count)
Reads a byte as count of bits from the current stream and advances the current
position of the stream by count bits.
|
byte[] |
readBytes(int count)
Reads a bytes by count from the current stream and advances the current
position of the stream by count bits.
|
float |
readFloat()
Reads four bits from current stream and advance the current position.
|
long |
readUInt(int count)
Reads a unsigned integer as count of bits from the current stream and advances the current
position of the stream by count bits.
|
int |
readUInt16()
Reads a unsigned integer as 16 of bits from the current stream and advances the current
position of the stream by count bits.
|
int |
seek(int offset)
Sets the position from beginning
|
public BitReader(byte val)
Initializes a new instance of the BitReader
class.
val
- The byte value.public BitReader(byte[] bytes)
Initializes a new instance of the BitReader
class.
bytes
- The byte array value.public boolean read()
Reads one bit from current stream and advance the current position.
public float readFloat()
Reads four bits from current stream and advance the current position.
public long readUInt(int count)
Reads a unsigned integer as count of bits from the current stream and advances the current position of the stream by count bits.
count
- The count of bits.public int readUInt16()
Reads a unsigned integer as 16 of bits from the current stream and advances the current position of the stream by count bits.
public boolean readBoolean()
Reads a Boolean value from the current stream and advances the current position of the stream by one bit.
public byte readByte()
Reads a byte from the current stream and advances the current position of the stream by count bits.
public byte readByte(int count)
Reads a byte as count of bits from the current stream and advances the current position of the stream by count bits.
count
- The count of bits.public byte[] readBytes(int count)
Reads a bytes by count from the current stream and advances the current position of the stream by count bits.
count
- The count of bits.public com.aspose.ms.System.Collections.BitArray readBits(int count)
Reads a byte as count of bits from the current stream and advances the current position of the stream by count bits.
count
- The count of bits.public int seek(int offset)
Sets the position from beginning
offset
- A bits offset relative to the origin parameter.Copyright (c) 2017 Aspose. All Rights Reserved.