C# Class CSMongo.IO.DynamicStream

Works with bytes that could be modified in different locations at any given time
Show file Open project: hugoware/CSMongo Class Usage Examples

Public Methods

Method Description
Append ( byte @byte ) : void

Appends the byte to the end of the stream

DynamicStream ( ) : System.Collections.Generic

Creates an empty DynamicStream

DynamicStream ( int length ) : System.Collections.Generic

Creates a stream with the provided length with all 0 bytes

DynamicStream ( int length, byte @default ) : System.Collections.Generic

Creates a stream with the provided length defaulting to the byte specified

InsertAt ( int index, byte bytes ) : void

Inserts a new byte at the specified index

Read ( int start, int length ) : byte[]

Reads the bytes within the specified area

ToArray ( ) : byte[]

Returns all of the bytes for the stream as an array

WriteAt ( int index, byte @byte ) : void

Overwrites the byte at the specified index

Private Methods

Method Description
_Reset ( ) : void

Method Details

Append() public method

Appends the byte to the end of the stream
public Append ( byte @byte ) : void
@byte byte
return void

DynamicStream() public method

Creates an empty DynamicStream
public DynamicStream ( ) : System.Collections.Generic
return System.Collections.Generic

DynamicStream() public method

Creates a stream with the provided length with all 0 bytes
public DynamicStream ( int length ) : System.Collections.Generic
length int
return System.Collections.Generic

DynamicStream() public method

Creates a stream with the provided length defaulting to the byte specified
public DynamicStream ( int length, byte @default ) : System.Collections.Generic
length int
@default byte
return System.Collections.Generic

InsertAt() public method

Inserts a new byte at the specified index
public InsertAt ( int index, byte bytes ) : void
index int
bytes byte
return void

Read() public method

Reads the bytes within the specified area
public Read ( int start, int length ) : byte[]
start int
length int
return byte[]

ToArray() public method

Returns all of the bytes for the stream as an array
public ToArray ( ) : byte[]
return byte[]

WriteAt() public method

Overwrites the byte at the specified index
public WriteAt ( int index, byte @byte ) : void
index int
@byte byte
return void