BitArrayWriter
Ecng.Collections
Provides a writer for bit-level data to a stream.
継承元: Disposable
コンストラクター
BitArrayWriter
public BitArrayWriter(Stream underlyingStream)
bitArrayWriter = BitArrayWriter(underlyingStream)
Provides a writer for bit-level data to a stream.
メソッド
DisposeManaged
protected override void DisposeManaged()
bitArrayWriter.DisposeManaged()
Disposes the writer, ensuring any remaining bits are flushed to the stream.
Flush
private void Flush()
bitArrayWriter.Flush()
Flushes the current byte to the underlying stream and resets the buffer.
Write
public void Write(bool bit)
bitArrayWriter.Write(bit)
Writes a single bit to the stream.
- bit
- The bit to write.
WriteBits
public void WriteBits(int value, int bitCount)
bitArrayWriter.WriteBits(value, bitCount)
Writes a specified number of bits from an integer value to the stream.
- value
- The integer value to write.
- bitCount
- The number of bits to write.
WriteBits
public void WriteBits(long value, int bitCount)
bitArrayWriter.WriteBits(value, bitCount)
Writes a specified number of bits from a long integer value to the stream.
- value
- The long integer value to write.
- bitCount
- The number of bits to write.
WriteDecimal
public void WriteDecimal(decimal value)
bitArrayWriter.WriteDecimal(value)
Writes a decimal value to the stream.
- value
- The decimal value to write.
WriteInt
public void WriteInt(int value)
bitArrayWriter.WriteInt(value)
Writes an integer value to the stream using a variable-length encoding.
- value
- The integer value to write.
WriteLong
public void WriteLong(long value)
bitArrayWriter.WriteLong(value)
Writes a long integer value to the stream using a variable-length encoding.
- value
- The long integer value to write.