C# Class System.StreamExtensions

Show file Open project: GoodAI/BrainSimulator

Private Properties

Property Type Description

Public Methods

Method Description
CheckGZipHeader ( this stream ) : bool
Read7BitEncodedInt ( this stream ) : int
ReadByteNoAlloc ( this stream ) : byte
ReadDecimal ( this stream ) : decimal
ReadDouble ( this stream ) : double
ReadFloat ( this stream ) : float
ReadInt16 ( this stream ) : Int16
ReadInt32 ( this stream ) : Int32
ReadInt64 ( this stream ) : System.Int64
ReadNoAlloc ( this stream, byte bytes, int offset, int count ) : void
ReadString ( this stream, Encoding encoding = null ) : string
ReadUInt16 ( this stream ) : UInt16
ReadUInt32 ( this stream ) : UInt32
ReadUInt64 ( this stream ) : System.UInt64
SkipBytes ( this stream, int byteCount ) : void
UnwrapGZip ( this stream ) : Stream

Checks for GZip header and if found, returns decompressed Stream, otherwise original Stream

WrapGZip ( this stream, bool buffered = true ) : Stream

Wraps stream into GZip compression stream resulting in writing compressed stream

Write7BitEncodedInt ( this stream, int value ) : void
WriteNoAlloc ( this stream, Int16 v ) : void
WriteNoAlloc ( this stream, Int32 v ) : void
WriteNoAlloc ( this stream, System.Int64 v ) : void
WriteNoAlloc ( this stream, UInt16 v ) : void
WriteNoAlloc ( this stream, UInt32 v ) : void
WriteNoAlloc ( this stream, System.UInt64 v ) : void
WriteNoAlloc ( this stream, byte value ) : void
WriteNoAlloc ( this stream, byte bytes, int offset, int count ) : void
WriteNoAlloc ( this stream, decimal v ) : void
WriteNoAlloc ( this stream, double v ) : void
WriteNoAlloc ( this stream, float v ) : void
WriteNoAlloc ( this stream, string text, Encoding encoding = null ) : void

Writes byte count prefixed encoded text into the file. Byte count is written as 7-bit encoded 32-bit int. If no encoding is specified, UTF-8 will be used. Byte count prefix specifies number of bytes taken up by the string, not length of the string itself. Note that this method may allocate if the size of encoded string exceeds size of prepared buffer.

Method Details

CheckGZipHeader() public static method

public static CheckGZipHeader ( this stream ) : bool
stream this
return bool

Read7BitEncodedInt() public static method

public static Read7BitEncodedInt ( this stream ) : int
stream this
return int

ReadByteNoAlloc() public static method

public static ReadByteNoAlloc ( this stream ) : byte
stream this
return byte

ReadDecimal() public static method

public static ReadDecimal ( this stream ) : decimal
stream this
return decimal

ReadDouble() public static method

public static ReadDouble ( this stream ) : double
stream this
return double

ReadFloat() public static method

public static ReadFloat ( this stream ) : float
stream this
return float

ReadInt16() public static method

public static ReadInt16 ( this stream ) : Int16
stream this
return Int16

ReadInt32() public static method

public static ReadInt32 ( this stream ) : Int32
stream this
return Int32

ReadInt64() public static method

public static ReadInt64 ( this stream ) : System.Int64
stream this
return System.Int64

ReadNoAlloc() public static method

public static ReadNoAlloc ( this stream, byte bytes, int offset, int count ) : void
stream this
bytes byte
offset int
count int
return void

ReadString() public static method

public static ReadString ( this stream, Encoding encoding = null ) : string
stream this
encoding Encoding
return string

ReadUInt16() public static method

public static ReadUInt16 ( this stream ) : UInt16
stream this
return UInt16

ReadUInt32() public static method

public static ReadUInt32 ( this stream ) : UInt32
stream this
return UInt32

ReadUInt64() public static method

public static ReadUInt64 ( this stream ) : System.UInt64
stream this
return System.UInt64

SkipBytes() public static method

public static SkipBytes ( this stream, int byteCount ) : void
stream this
byteCount int
return void

UnwrapGZip() public static method

Checks for GZip header and if found, returns decompressed Stream, otherwise original Stream
public static UnwrapGZip ( this stream ) : Stream
stream this
return Stream

WrapGZip() public static method

Wraps stream into GZip compression stream resulting in writing compressed stream
public static WrapGZip ( this stream, bool buffered = true ) : Stream
stream this
buffered bool
return Stream

Write7BitEncodedInt() public static method

public static Write7BitEncodedInt ( this stream, int value ) : void
stream this
value int
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, Int16 v ) : void
stream this
v Int16
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, Int32 v ) : void
stream this
v Int32
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, System.Int64 v ) : void
stream this
v System.Int64
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, UInt16 v ) : void
stream this
v UInt16
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, UInt32 v ) : void
stream this
v UInt32
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, System.UInt64 v ) : void
stream this
v System.UInt64
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, byte value ) : void
stream this
value byte
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, byte bytes, int offset, int count ) : void
stream this
bytes byte
offset int
count int
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, decimal v ) : void
stream this
v decimal
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, double v ) : void
stream this
v double
return void

WriteNoAlloc() public static method

public static WriteNoAlloc ( this stream, float v ) : void
stream this
v float
return void

WriteNoAlloc() public static method

Writes byte count prefixed encoded text into the file. Byte count is written as 7-bit encoded 32-bit int. If no encoding is specified, UTF-8 will be used. Byte count prefix specifies number of bytes taken up by the string, not length of the string itself. Note that this method may allocate if the size of encoded string exceeds size of prepared buffer.
public static WriteNoAlloc ( this stream, string text, Encoding encoding = null ) : void
stream this
text string
encoding Encoding
return void