Space Engineers
Public Member Functions | Properties | List of all members
VRage.Library.Collections.BitStream Class Reference

Stream which writes data based on bits. When writing, buffer must be reset to zero to write values correctly, this is done by ResetWrite() methods or SetPositionAndClearForward() More...

Inheritance diagram for VRage.Library.Collections.BitStream:

Public Member Functions

 BitStream (int defaultByteSize=1536)
 
void Dispose ()
 
void ReleaseInternalBuffer ()
 
void ResetRead ()
 Resets stream for reading (reads what was written so far). More...
 
void ResetRead (byte[] data, int bitLength)
 Resets stream for reading and copies data. More...
 
void ResetRead (byte[] data, int byteOffset, int bitLength, bool copy=true)
 Resets stream for reading and copies data. More...
 
void ResetRead (IntPtr buffer, int bitLength, bool copy)
 Resets stream for reading. More...
 
void ResetWrite ()
 Resets stream for writing. Uses internal buffer for writing, it's available as DataPointer. More...
 
void ResetWrite (BitStream stream)
 
void Serialize (ref double value)
 
void Serialize (ref float value)
 
void Serialize (ref decimal value)
 
void Serialize (ref bool value)
 
void Serialize (ref sbyte value, int bitCount=sizeof(sbyte)*8)
 
void Serialize (ref short value, int bitCount=sizeof(short)*8)
 
void Serialize (ref int value, int bitCount=sizeof(int)*8)
 
void Serialize (ref long value, int bitCount=sizeof(long)*8)
 
void Serialize (ref byte value, int bitCount=sizeof(byte)*8)
 
void Serialize (ref ushort value, int bitCount=sizeof(ushort)*8)
 
void Serialize (ref uint value, int bitCount=sizeof(uint)*8)
 
void Serialize (ref ulong value, int bitCount=sizeof(ulong)*8)
 
void SerializeVariant (ref int value)
 Efficiently serializes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8 192 to 8 191 (inclusive), 16 bits. From -1 048 576 to 1 048 575, 24 bits. From -134 217 728 to 134 217 727, 32 bits. Otherwise 40 bits. More...
 
void SerializeVariant (ref long value)
 Efficiently serializes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8192 to 8191 (inclusive), 16 bits. From -1048576 to 1048575, 24 bits. From -134217728 to 134217727, 32 bits. Etc... More...
 
void SerializeVariant (ref uint value)
 Efficiently serializes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Otherwise 40 bits. More...
 
void SerializeVariant (ref ulong value)
 Efficiently serializes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Etc... More...
 
void Serialize (ref char value)
 Writes char as UTF16, 2-byte value. For ASCII or different encoding, use SerializeByte() or SerializeBytes(). More...
 
void Serialize (StringBuilder value, ref char[] tmpArray, Encoding encoding)
 
void SerializeMemory (IntPtr ptr, int bitSize)
 Serializes fixed size memory region. More...
 
unsafe void SerializeMemory (void *ptr, int bitSize)
 Serializes fixed size memory region. More...
 
void SerializePrefixString (ref string str, Encoding encoding)
 Serializes string length (as UInt32 variant) and string itself in defined encoding. More...
 
void SerializePrefixStringAscii (ref string str)
 Serializes string length (as UInt32 variant) and string itself encoded with ASCII encoding. More...
 
void SerializePrefixStringUtf8 (ref string str)
 Serializes string length (as UInt32 variant) and string itself encoded with UTF8 encoding. More...
 
void SerializePrefixBytes (ref byte[] bytes)
 Serializes byte array length (as UInt32 variant) and bytes. More...
 
void SerializeBytes (ref byte[] bytes, int start, int count)
 Serializes fixed-size byte array or it's part (length is NOT serialized). More...
 
void Terminate ()
 
void CheckTerminator ()
 
Type ReadDynamicType (Type baseType, DynamicSerializerDelegate typeResolver)
 
void WriteDynamicType (Type baseType, Type obj, DynamicSerializerDelegate typeResolver)
 
void SetBitPositionRead (int newReadBitPosition)
 
double ReadDouble ()
 
float ReadHalf ()
 
float ReadFloat ()
 
float ReadNormalizedSignedFloat (int bits)
 Reads uniform-spaced float within -1,1 range with specified number of bits. More...
 
decimal ReadDecimal ()
 
bool ReadBool ()
 
sbyte ReadSByte (int bitCount=sizeof(sbyte)*8)
 
short ReadInt16 (int bitCount=sizeof(short)*8)
 
int ReadInt32 (int bitCount=sizeof(int)*8)
 
long ReadInt64 (int bitCount=sizeof(long)*8)
 
byte ReadByte (int bitCount=sizeof(byte)*8)
 
ushort ReadUInt16 (int bitCount=sizeof(ushort)*8)
 
uint ReadUInt32 (int bitCount=sizeof(uint)*8)
 
ulong ReadUInt64 (int bitCount=sizeof(ulong)*8)
 
int ReadInt32Variant ()
 
long ReadInt64Variant ()
 
uint ReadUInt32Variant ()
 
ulong ReadUInt64Variant ()
 
char ReadChar (int bitCount=sizeof(char)*8)
 
void ReadMemory (IntPtr ptr, int bitSize)
 
void ReadMemory (void *ptr, int bitSize)
 
string ReadPrefixLengthString (Encoding encoding)
 
int ReadPrefixLengthString (ref char[] value, Encoding encoding)
 Reads prefixed length string, returns nubmer of characters read. Passed array is automatically resized when needed. More...
 
void ReadBytes (byte[] bytes, int start, int count)
 
byte[] ReadPrefixBytes ()
 
void SetBitPositionWrite (int newBitPosition)
 Use when you need to overwrite part of the data. Sets new bit position and clears everything from min(old position, new position) to end of stream. More...
 
void WriteDouble (double value)
 
void WriteHalf (float value)
 
void WriteFloat (float value)
 
void WriteNormalizedSignedFloat (float value, int bits)
 Writes uniform-spaced float within -1,1 range with specified number of bits. More...
 
void WriteDecimal (decimal value)
 
void WriteBool (bool value)
 
void WriteSByte (sbyte value, int bitCount=sizeof(sbyte)*8)
 
void WriteInt16 (short value, int bitCount=sizeof(short)*8)
 
void WriteInt32 (int value, int bitCount=sizeof(int)*8)
 
void WriteInt64 (long value, int bitCount=sizeof(long)*8)
 
void WriteByte (byte value, int bitCount=sizeof(byte)*8)
 
void WriteUInt16 (ushort value, int bitCount=sizeof(ushort)*8)
 
void WriteUInt32 (uint value, int bitCount=sizeof(uint)*8)
 
void WriteUInt64 (ulong value, int bitCount=sizeof(ulong)*8)
 
void WriteVariantSigned (int value)
 Efficiently writes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8 192 to 8 191 (inclusive), 16 bits. From -1 048 576 to 1 048 575, 24 bits. From -134 217 728 to 134 217 727, 32 bits. Otherwise 40 bits. More...
 
void WriteVariantSigned (long value)
 Efficiently writes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8192 to 8191 (inclusive), 16 bits. From -1048576 to 1048575, 24 bits. From -134217728 to 134217727, 32 bits. Etc... More...
 
void WriteVariant (uint value)
 Efficiently writes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Otherwise 40 bits. More...
 
void WriteVariant (ulong value)
 Efficiently writes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Etc... More...
 
void WriteChar (char value, int bitCount=sizeof(char)*8)
 
void WriteBitStream (BitStream readStream)
 
void WriteMemory (IntPtr ptr, int bitSize)
 
void WriteMemory (void *ptr, int bitSize)
 
unsafe void WritePrefixLengthString (string str, int characterStart, int characterCount, Encoding encoding)
 
unsafe void WritePrefixLengthString (char[] str, int characterStart, int characterCount, Encoding encoding)
 
void WriteBytes (byte[] bytes, int start, int count)
 
void WritePrefixBytes (byte[] bytes, int start, int count)
 

Properties

int BitPosition [get]
 Read/write bit position in stream. More...
 
int BitLength [get]
 Length of valid data (when reading) or buffer (when writing) in bits. More...
 
int BytePosition [get]
 Position in stream round up to whole bytes. More...
 
int ByteLength [get]
 Length of valid data (when reading) or buffer (when writing) round up to whole bytes More...
 
bool OwnsBuffer [get]
 Returns true when owns buffers, always true when writing. May or may not own buffer when reading. More...
 
bool Reading [get]
 
bool Writing [get]
 True when stream is for writing. More...
 
IntPtr DataPointer [get]
 

Detailed Description

Stream which writes data based on bits. When writing, buffer must be reset to zero to write values correctly, this is done by ResetWrite() methods or SetPositionAndClearForward()

Definition at line 20 of file BitStream.cs.

Constructor & Destructor Documentation

VRage.Library.Collections.BitStream.BitStream ( int  defaultByteSize = 1536)
inline

Definition at line 73 of file BitStream.cs.

Member Function Documentation

void VRage.Library.Collections.BitStream.CheckTerminator ( )
inline

Definition at line 477 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Dispose ( )
inline

Definition at line 79 of file BitStream.cs.

bool VRage.Library.Collections.BitStream.ReadBool ( )
inline

Definition at line 88 of file BitStream.Read.cs.

byte VRage.Library.Collections.BitStream.ReadByte ( int  bitCount = sizeof(byte) * 8)
inline

Definition at line 113 of file BitStream.Read.cs.

void VRage.Library.Collections.BitStream.ReadBytes ( byte[]  bytes,
int  start,
int  count 
)
inline

Definition at line 327 of file BitStream.Read.cs.

char VRage.Library.Collections.BitStream.ReadChar ( int  bitCount = sizeof(char) * 8)
inline

Definition at line 227 of file BitStream.Read.cs.

decimal VRage.Library.Collections.BitStream.ReadDecimal ( )
inline

Definition at line 80 of file BitStream.Read.cs.

double VRage.Library.Collections.BitStream.ReadDouble ( )
inline

Definition at line 55 of file BitStream.Read.cs.

Type VRage.Library.Collections.BitStream.ReadDynamicType ( Type  baseType,
DynamicSerializerDelegate  typeResolver 
)
inline

Definition at line 10 of file BitStream.Dynamic.cs.

float VRage.Library.Collections.BitStream.ReadFloat ( )
inline

Definition at line 66 of file BitStream.Read.cs.

float VRage.Library.Collections.BitStream.ReadHalf ( )
inline

Definition at line 61 of file BitStream.Read.cs.

short VRage.Library.Collections.BitStream.ReadInt16 ( int  bitCount = sizeof(short) * 8)
inline

Definition at line 98 of file BitStream.Read.cs.

int VRage.Library.Collections.BitStream.ReadInt32 ( int  bitCount = sizeof(int) * 8)
inline

Definition at line 103 of file BitStream.Read.cs.

int VRage.Library.Collections.BitStream.ReadInt32Variant ( )
inline

Definition at line 145 of file BitStream.Read.cs.

long VRage.Library.Collections.BitStream.ReadInt64 ( int  bitCount = sizeof(long) * 8)
inline

Definition at line 108 of file BitStream.Read.cs.

long VRage.Library.Collections.BitStream.ReadInt64Variant ( )
inline

Definition at line 150 of file BitStream.Read.cs.

void VRage.Library.Collections.BitStream.ReadMemory ( IntPtr  ptr,
int  bitSize 
)
inline

Definition at line 232 of file BitStream.Read.cs.

void VRage.Library.Collections.BitStream.ReadMemory ( void *  ptr,
int  bitSize 
)
inline

Definition at line 237 of file BitStream.Read.cs.

float VRage.Library.Collections.BitStream.ReadNormalizedSignedFloat ( int  bits)
inline

Reads uniform-spaced float within -1,1 range with specified number of bits.

Definition at line 75 of file BitStream.Read.cs.

byte [] VRage.Library.Collections.BitStream.ReadPrefixBytes ( )
inline

Definition at line 335 of file BitStream.Read.cs.

string VRage.Library.Collections.BitStream.ReadPrefixLengthString ( Encoding  encoding)
inline

Definition at line 256 of file BitStream.Read.cs.

int VRage.Library.Collections.BitStream.ReadPrefixLengthString ( ref char[]  value,
Encoding  encoding 
)
inline

Reads prefixed length string, returns nubmer of characters read. Passed array is automatically resized when needed.

Returns
Nubmer of characters read.

Definition at line 290 of file BitStream.Read.cs.

sbyte VRage.Library.Collections.BitStream.ReadSByte ( int  bitCount = sizeof(sbyte) * 8)
inline

Definition at line 93 of file BitStream.Read.cs.

ushort VRage.Library.Collections.BitStream.ReadUInt16 ( int  bitCount = sizeof(ushort) * 8)
inline

Definition at line 118 of file BitStream.Read.cs.

uint VRage.Library.Collections.BitStream.ReadUInt32 ( int  bitCount = sizeof(uint) * 8)
inline

Definition at line 123 of file BitStream.Read.cs.

uint VRage.Library.Collections.BitStream.ReadUInt32Variant ( )
inline

Definition at line 155 of file BitStream.Read.cs.

ulong VRage.Library.Collections.BitStream.ReadUInt64 ( int  bitCount = sizeof(ulong) * 8)
inline

Definition at line 128 of file BitStream.Read.cs.

ulong VRage.Library.Collections.BitStream.ReadUInt64Variant ( )
inline

Definition at line 180 of file BitStream.Read.cs.

void VRage.Library.Collections.BitStream.ReleaseInternalBuffer ( )
inline

Definition at line 119 of file BitStream.cs.

void VRage.Library.Collections.BitStream.ResetRead ( )
inline

Resets stream for reading (reads what was written so far).

Definition at line 137 of file BitStream.cs.

void VRage.Library.Collections.BitStream.ResetRead ( byte[]  data,
int  bitLength 
)
inline

Resets stream for reading and copies data.

Definition at line 148 of file BitStream.cs.

void VRage.Library.Collections.BitStream.ResetRead ( byte[]  data,
int  byteOffset,
int  bitLength,
bool  copy = true 
)
inline

Resets stream for reading and copies data.

Definition at line 156 of file BitStream.cs.

void VRage.Library.Collections.BitStream.ResetRead ( IntPtr  buffer,
int  bitLength,
bool  copy 
)
inline

Resets stream for reading.

Definition at line 167 of file BitStream.cs.

void VRage.Library.Collections.BitStream.ResetWrite ( )
inline

Resets stream for writing. Uses internal buffer for writing, it's available as DataPointer.

Definition at line 205 of file BitStream.cs.

void VRage.Library.Collections.BitStream.ResetWrite ( BitStream  stream)
inline

Definition at line 223 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref double  value)
inline

Definition at line 244 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref float  value)
inline

Definition at line 250 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref decimal  value)
inline

Definition at line 256 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref bool  value)
inline

Definition at line 262 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref sbyte  value,
int  bitCount = sizeof(sbyte) * 8 
)
inline

Definition at line 268 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref short  value,
int  bitCount = sizeof(short) * 8 
)
inline

Definition at line 274 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref int  value,
int  bitCount = sizeof(int) * 8 
)
inline

Definition at line 280 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref long  value,
int  bitCount = sizeof(long) * 8 
)
inline

Definition at line 286 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref byte  value,
int  bitCount = sizeof(byte) * 8 
)
inline

Definition at line 292 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref ushort  value,
int  bitCount = sizeof(ushort) * 8 
)
inline

Definition at line 298 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref uint  value,
int  bitCount = sizeof(uint) * 8 
)
inline

Definition at line 304 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref ulong  value,
int  bitCount = sizeof(ulong) * 8 
)
inline

Definition at line 310 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( ref char  value)
inline

Writes char as UTF16, 2-byte value. For ASCII or different encoding, use SerializeByte() or SerializeBytes().

Definition at line 376 of file BitStream.cs.

void VRage.Library.Collections.BitStream.Serialize ( StringBuilder  value,
ref char[]  tmpArray,
Encoding  encoding 
)
inline

Definition at line 382 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializeBytes ( ref byte[]  bytes,
int  start,
int  count 
)
inline

Serializes fixed-size byte array or it's part (length is NOT serialized).

Definition at line 464 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializeMemory ( IntPtr  ptr,
int  bitSize 
)
inline

Serializes fixed size memory region.

Definition at line 402 of file BitStream.cs.

unsafe void VRage.Library.Collections.BitStream.SerializeMemory ( void *  ptr,
int  bitSize 
)
inline

Serializes fixed size memory region.

Definition at line 411 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializePrefixBytes ( ref byte[]  bytes)
inline

Serializes byte array length (as UInt32 variant) and bytes.

Definition at line 446 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializePrefixString ( ref string  str,
Encoding  encoding 
)
inline

Serializes string length (as UInt32 variant) and string itself in defined encoding.

Definition at line 420 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializePrefixStringAscii ( ref string  str)
inline

Serializes string length (as UInt32 variant) and string itself encoded with ASCII encoding.

Definition at line 429 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializePrefixStringUtf8 ( ref string  str)
inline

Serializes string length (as UInt32 variant) and string itself encoded with UTF8 encoding.

Parameters
str

Definition at line 438 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializeVariant ( ref int  value)
inline

Efficiently serializes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8 192 to 8 191 (inclusive), 16 bits. From -1 048 576 to 1 048 575, 24 bits. From -134 217 728 to 134 217 727, 32 bits. Otherwise 40 bits.

Definition at line 324 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializeVariant ( ref long  value)
inline

Efficiently serializes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8192 to 8191 (inclusive), 16 bits. From -1048576 to 1048575, 24 bits. From -134217728 to 134217727, 32 bits. Etc...

Definition at line 338 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializeVariant ( ref uint  value)
inline

Efficiently serializes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Otherwise 40 bits.

Definition at line 352 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SerializeVariant ( ref ulong  value)
inline

Efficiently serializes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Etc...

Definition at line 366 of file BitStream.cs.

void VRage.Library.Collections.BitStream.SetBitPositionRead ( int  newReadBitPosition)
inline

Definition at line 49 of file BitStream.Read.cs.

void VRage.Library.Collections.BitStream.SetBitPositionWrite ( int  newBitPosition)
inline

Use when you need to overwrite part of the data. Sets new bit position and clears everything from min(old position, new position) to end of stream.

Definition at line 56 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.Terminate ( )
inline

Definition at line 471 of file BitStream.cs.

void VRage.Library.Collections.BitStream.WriteBitStream ( BitStream  readStream)
inline

Definition at line 233 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteBool ( bool  value)
inline

Definition at line 94 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteByte ( byte  value,
int  bitCount = sizeof(byte) * 8 
)
inline

Definition at line 119 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteBytes ( byte[]  bytes,
int  start,
int  count 
)
inline

Definition at line 306 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteChar ( char  value,
int  bitCount = sizeof(char) * 8 
)
inline

Definition at line 228 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteDecimal ( decimal  value)
inline

Definition at line 88 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteDouble ( double  value)
inline

Definition at line 64 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteDynamicType ( Type  baseType,
Type  obj,
DynamicSerializerDelegate  typeResolver 
)
inline

Definition at line 17 of file BitStream.Dynamic.cs.

void VRage.Library.Collections.BitStream.WriteFloat ( float  value)
inline

Definition at line 75 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteHalf ( float  value)
inline

Definition at line 69 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteInt16 ( short  value,
int  bitCount = sizeof(short) * 8 
)
inline

Definition at line 104 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteInt32 ( int  value,
int  bitCount = sizeof(int) * 8 
)
inline

Definition at line 109 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteInt64 ( long  value,
int  bitCount = sizeof(long) * 8 
)
inline

Definition at line 114 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteMemory ( IntPtr  ptr,
int  bitSize 
)
inline

Definition at line 246 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteMemory ( void *  ptr,
int  bitSize 
)
inline

Definition at line 251 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteNormalizedSignedFloat ( float  value,
int  bits 
)
inline

Writes uniform-spaced float within -1,1 range with specified number of bits.

Definition at line 83 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WritePrefixBytes ( byte[]  bytes,
int  start,
int  count 
)
inline

Definition at line 314 of file BitStream.Write.cs.

unsafe void VRage.Library.Collections.BitStream.WritePrefixLengthString ( string  str,
int  characterStart,
int  characterCount,
Encoding  encoding 
)
inline

Definition at line 270 of file BitStream.Write.cs.

unsafe void VRage.Library.Collections.BitStream.WritePrefixLengthString ( char[]  str,
int  characterStart,
int  characterCount,
Encoding  encoding 
)
inline

Definition at line 278 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteSByte ( sbyte  value,
int  bitCount = sizeof(sbyte) * 8 
)
inline

Definition at line 99 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteUInt16 ( ushort  value,
int  bitCount = sizeof(ushort) * 8 
)
inline

Definition at line 124 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteUInt32 ( uint  value,
int  bitCount = sizeof(uint) * 8 
)
inline

Definition at line 129 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteUInt64 ( ulong  value,
int  bitCount = sizeof(ulong) * 8 
)
inline

Definition at line 134 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteVariant ( uint  value)
inline

Efficiently writes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Otherwise 40 bits.

Definition at line 183 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteVariant ( ulong  value)
inline

Efficiently writes small integers. Closer to zero, less bytes. 0 - 127, 8 bits. 128 - 16383, 16 bits. 16384 - 2097151, 24 bits. 2097152 - 268435455, 32 bits. Etc...

Definition at line 206 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteVariantSigned ( int  value)
inline

Efficiently writes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8 192 to 8 191 (inclusive), 16 bits. From -1 048 576 to 1 048 575, 24 bits. From -134 217 728 to 134 217 727, 32 bits. Otherwise 40 bits.

Definition at line 157 of file BitStream.Write.cs.

void VRage.Library.Collections.BitStream.WriteVariantSigned ( long  value)
inline

Efficiently writes small integers. Closer to zero, less bytes. From -64 to 63 (inclusive), 8 bits. From -8192 to 8191 (inclusive), 16 bits. From -1048576 to 1048575, 24 bits. From -134217728 to 134217727, 32 bits. Etc...

Definition at line 170 of file BitStream.Write.cs.

Property Documentation

int VRage.Library.Collections.BitStream.BitLength
get

Length of valid data (when reading) or buffer (when writing) in bits.

Definition at line 43 of file BitStream.cs.

int VRage.Library.Collections.BitStream.BitPosition
get

Read/write bit position in stream.

Definition at line 38 of file BitStream.cs.

int VRage.Library.Collections.BitStream.ByteLength
get

Length of valid data (when reading) or buffer (when writing) round up to whole bytes

Definition at line 53 of file BitStream.cs.

int VRage.Library.Collections.BitStream.BytePosition
get

Position in stream round up to whole bytes.

Definition at line 48 of file BitStream.cs.

IntPtr VRage.Library.Collections.BitStream.DataPointer
get

Definition at line 69 of file BitStream.cs.

bool VRage.Library.Collections.BitStream.OwnsBuffer
get

Returns true when owns buffers, always true when writing. May or may not own buffer when reading.

Definition at line 59 of file BitStream.cs.

bool VRage.Library.Collections.BitStream.Reading
get

Definition at line 61 of file BitStream.cs.

bool VRage.Library.Collections.BitStream.Writing
get

True when stream is for writing.

Definition at line 66 of file BitStream.cs.


The documentation for this class was generated from the following files: