BitArrayReader
Provides a reader for bit-level data from a stream.
コンストラクター
public BitArrayReader(byte[] underlyingData)
bitArrayReader = BitArrayReader(underlyingData)
Initializes a new instance of the BitArrayReader class with the specified underlying stream.
- underlyingData
- The stream to read bit-level data from.
public BitArrayReader(Stream underlyingStream)
bitArrayReader = BitArrayReader(underlyingStream)
Initializes a new instance of the BitArrayReader class with the specified underlying stream.
- underlyingStream
- The stream to read bit-level data from.
プロパティ
public long Offset { get; set; }
value = bitArrayReader.Offset
bitArrayReader.Offset = value
Gets or sets the current bit offset within the stream.
メソッド
private ulong Get(long offset)
result = bitArrayReader.Get(offset)
Retrieves the 64-bit value at the specified offset.
- offset
- The offset to read from.
戻り値: The 64-bit value at the specified offset.
public bool Read()
result = bitArrayReader.Read()
Reads a single bit from the stream.
戻り値: The value of the bit read.
public int Read(int count)
result = bitArrayReader.Read(count)
Reads a specified number of bits from the stream as an integer.
- count
- The number of bits to read.
戻り値: The integer value represented by the bits read.
public bool[] ReadArray(int count)
result = bitArrayReader.ReadArray(count)
Reads an array of bits from the stream.
- count
- The number of bits to read.
戻り値: An array of boolean values representing the bits read.
public decimal ReadDecimal()
result = bitArrayReader.ReadDecimal()
Reads a decimal value from the stream.
戻り値: The decimal value read from the stream.
public int ReadInt()
result = bitArrayReader.ReadInt()
Reads an integer value from the stream using a variable-length encoding.
戻り値: The integer value read from the stream.
public long ReadLong(int count)
result = bitArrayReader.ReadLong(count)
Reads a specified number of bits from the stream as a long integer.
- count
- The number of bits to read.
戻り値: The long integer value represented by the bits read.
public long ReadLong()
result = bitArrayReader.ReadLong()
Reads a long integer value from the stream using a variable-length encoding.
戻り値: The long integer value read from the stream.
public void Seek(int offset)
bitArrayReader.Seek(offset)
Moves the current bit offset by the specified number of bits.
- offset
- The number of bits to move the offset by.