Click or drag to resize

BitStream Class

[This is preliminary documentation and is subject to change.]

A stream that can be used at the bit level
Inheritance Hierarchy

Namespace:  MLAPI.Serialization
Assembly:  MLAPI (in MLAPI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class BitStream : Stream
Request Example View Source

The BitStream type exposes the following members.

Constructors
  NameDescription
Public methodBitStream
A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data.
Public methodBitStream(Byte)
A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data. NOTE: when using a pre-allocated buffer, the stream will not grow!
Public methodBitStream(Int32)
A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data.
Public methodBitStream(Single)
A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data.
Public methodBitStream(Int32, Single)
A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data.
Public methodBitStream(Byte, Int32, Int32)
A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data.
Top
Properties
  NameDescription
Public propertyBitAligned
Whether or not the current BitPosition is evenly divisible by 8. I.e. whether or not the BitPosition is at a byte boundary.
Public propertyBitLength
Length of data (in bits) that is considered to be written to the stream.
Public propertyBitPosition
Bit offset into the buffer that new data will be written to.
Public propertyCanRead
Whether or not data can be read from the stream.
(Overrides StreamCanRead.)
Public propertyCanSeek
Whether or not seeking is supported by this stream. (Always true)
(Overrides StreamCanSeek.)
Public propertyCanTimeout (Inherited from Stream.)
Public propertyCanWrite
Whether or not this stream can accept new data. NOTE: this will return true even if only fewer than 8 bits can be written!
(Overrides StreamCanWrite.)
Public propertyCapacity
Current buffer size. The buffer will not be resized (if possible) until Position is equal to Capacity and an attempt to write data is made.
Public propertyGrowthFactor
Factor by which buffer should grow when necessary.
Public propertyLength
The current length of data considered to be "written" to the buffer.
(Overrides StreamLength.)
Public propertyPosition
The index that will be written to when any call to write data is made to this stream.
(Overrides StreamPosition.)
Public propertyReadTimeout (Inherited from Stream.)
Public propertyResizable
Whether or not the stream will grow the buffer to accomodate more data.
Public propertyWriteTimeout (Inherited from Stream.)
Top
Methods
  NameDescription
Public methodBeginRead (Inherited from Stream.)
Public methodBeginWrite (Inherited from Stream.)
Public methodClose (Inherited from Stream.)
Public methodCopyFrom(Stream, Int32)
Copy data from another stream
Public methodCopyFrom(BitStream, Int32, Boolean)
Copys the bits from the provided BitStream
Public methodCopyUnreadFrom
Public methodCreateObjRef (Inherited from MarshalByRefObject.)
Protected methodCreateWaitHandle Obsolete. (Inherited from Stream.)
Public methodDispose (Inherited from Stream.)
Protected methodDispose(Boolean) (Inherited from Stream.)
Public methodEndRead (Inherited from Stream.)
Public methodEndWrite (Inherited from Stream.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFlush
Flush stream. This does nothing since data is written directly to a byte buffer.
(Overrides StreamFlush.)
Public methodGetBuffer
Get the internal buffer being written to by this stream.
Public methodGetHashCode (Inherited from Object.)
Public methodGetLifetimeService (Inherited from MarshalByRefObject.)
Public methodGetType (Inherited from Object.)
Public methodInitializeLifetimeService (Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodMemberwiseClone(Boolean) (Inherited from MarshalByRefObject.)
Public methodPeekByte
Peeks a byte without advancing the position
Public methodRead
Read a subset of the stream buffer and write the contents to the supplied buffer.
(Overrides StreamRead(Byte, Int32, Int32).)
Public methodReadBit
Read a single bit from the stream.
Public methodReadByte
Read a byte from the buffer. This takes into account possible byte misalignment.
(Overrides StreamReadByte.)
Public methodSeek
Set position in stream to read from/write to.
(Overrides StreamSeek(Int64, SeekOrigin).)
Public methodSetLength
Set length of data considered to be "written" to the stream.
(Overrides StreamSetLength(Int64).)
Public methodToArray
Creates a copy of the internal buffer. This only contains the used bytes
Public methodToString
Returns hex encoded version of the buffer
(Overrides ObjectToString.)
Public methodWrite(Byte)
Write data from the given buffer to the internal stream buffer.
Public methodWrite(Byte, Int32, Int32)
Write data from the given buffer to the internal stream buffer.
(Overrides StreamWrite(Byte, Int32, Int32).)
Public methodWriteBit
Write a single bit to the stream
Public methodWriteByte (Inherited from Stream.)
Top
See Also