Table of Contents

Class BitArrayWriter

Namespace
Ecng.Collections
Assembly
Ecng.Collections.dll

Provides a writer for bit-level data to a stream.

public class BitArrayWriter : Disposable, IDisposable
Inheritance
BitArrayWriter
Implements
Inherited Members
Extension Methods

Constructors

BitArrayWriter(Stream)

Provides a writer for bit-level data to a stream.

public BitArrayWriter(Stream underlyingStream)

Parameters

underlyingStream Stream

Methods

DisposeManaged()

Disposes the writer, ensuring any remaining bits are flushed to the stream.

protected override void DisposeManaged()

Write(bool)

Writes a single bit to the stream.

public void Write(bool bit)

Parameters

bit bool

The bit to write.

WriteBits(int, int)

Writes a specified number of bits from an integer value to the stream.

public void WriteBits(int value, int bitCount)

Parameters

value int

The integer value to write.

bitCount int

The number of bits to write.

WriteBits(long, int)

Writes a specified number of bits from a long integer value to the stream.

public void WriteBits(long value, int bitCount)

Parameters

value long

The long integer value to write.

bitCount int

The number of bits to write.

WriteDecimal(decimal)

Writes a decimal value to the stream.

public void WriteDecimal(decimal value)

Parameters

value decimal

The decimal value to write.

WriteInt(int)

Writes an integer value to the stream using a variable-length encoding.

public void WriteInt(int value)

Parameters

value int

The integer value to write.

WriteLong(long)

Writes a long integer value to the stream using a variable-length encoding.

public void WriteLong(long value)

Parameters

value long

The long integer value to write.