C# Class DBreeze.Storage.MemoryStorage

Memory storage
Inheritance: IDisposable
Show file Open project: hhblaze/DBreeze Class Usage Examples

Public Methods

Method Description
Clear ( bool withInternalArrayResize ) : void

Sets EOF pointer to 0.

USE withInternalArrayResize by necessity. If it's true then array will be re-initialized to initial capacity

this also will call GC and the whole process will take some time.

If false, only pointer EOF will be set to 0, capacity of the array will not be changed - very fast

Dispose ( ) : void
GetFullData ( ) : byte[]

Can return null

MemoryStorage ( int initialCapacity, int increaseOnBytes, eMemoryExpandStartegy strategy ) : System

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

If length = 0 returns new byte[0]

Write_ByOffset ( int offset, byte &data ) : void

Write_ToTheEnd ( byte &data ) : int

Writes_ByOffsets ( byte[]>.Dictionary datas ) : void

Private Methods

Method Description
Resize ( int upTo ) : void
Write ( byte data, int offset ) : void

Method Details

Clear() public method

Sets EOF pointer to 0.

USE withInternalArrayResize by necessity. If it's true then array will be re-initialized to initial capacity

this also will call GC and the whole process will take some time.

If false, only pointer EOF will be set to 0, capacity of the array will not be changed - very fast

public Clear ( bool withInternalArrayResize ) : void
withInternalArrayResize bool
return void

Dispose() public method

public Dispose ( ) : void
return void

GetFullData() public method

Can return null
public GetFullData ( ) : byte[]
return byte[]

MemoryStorage() public method

public MemoryStorage ( int initialCapacity, int increaseOnBytes, eMemoryExpandStartegy strategy ) : System
initialCapacity int Initial Memory Capacity in bytes
increaseOnBytes int Rules is strategy is FIXED_LENGTH_INCREASE, quantity of bytes to increse memory
strategy eMemoryExpandStartegy Memory expand strategy
return System

Read() public method

If length = 0 returns new byte[0]
public Read ( int offset, int length ) : byte[]
offset int
length int
return byte[]

Write_ByOffset() public method

public Write_ByOffset ( int offset, byte &data ) : void
offset int
data byte
return void

Write_ToTheEnd() public method

public Write_ToTheEnd ( byte &data ) : int
data byte
return int

Writes_ByOffsets() public method

public Writes_ByOffsets ( byte[]>.Dictionary datas ) : void
datas byte[]>.Dictionary
return void