Method | Description | |
---|---|---|
Close ( ) : void |
Close the stream and flush any changes to the database.
|
|
Flush ( ) : void |
Flushes any changes to current chunk to the database. It can be called in client code at any time or it will automatically be called on Close() and when the stream position moves off the bounds of the current chunk.
|
|
GridFileStream ( |
||
Read ( byte array, int offset, int count ) : int |
Reads data from the stream into the specified array. It will fill the array in starting at offset and adding count bytes returning the number of bytes read from the stream.
|
|
Seek ( long offset, SeekOrigin origin ) : long |
Seek to any location in the stream. Seeking past the end of the file is allowed. Any writes to that location will cause the file to grow to that size. Any holes that may be created from the seek will be zero filled on close.
|
|
SetLength ( long value ) : void |
Sets the length of this stream to the given value.
|
|
Write ( byte array, int offset, int count ) : void |
Copies from the source array into the grid file.
|
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Method | Description | |
---|---|---|
CalcChunkNum ( long position ) : int | ||
EnsureNoHoles ( ) : void |
Makes sure that at least a skelton chunk exists for all numbers. If not the MD5 calculation will fail on a sparse file.
|
|
LoadOrCreateChunk ( int num ) : void |
Loads a chunk from the chunks collection if it exists. Otherwise it creates a blank chunk Document.
|
|
MoveTo ( long position ) : void |
Moves the current position to the new position. If this causes a new chunk to need to be loaded it will take care of flushing the buffer and loading a new chunk.
|
|
TruncateAfter ( long value ) : void |
Deletes all chunks after the specified position and clears out any extra bytes if the position doesn't fall on a chunk boundry.
|
|
ValidateReadState ( byte array, int offset, int count ) : void | ||
ValidateWriteState ( byte array, int offset, int count ) : void |
public GridFileStream ( |
||
gridfileinfo | ||
files | IMongoCollection | |
chunks | IMongoCollection | |
access | FileAccess | |
return | System |
public Read ( byte array, int offset, int count ) : int | ||
array | byte | |
offset | int | |
count | int | |
return | int |
public Seek ( long offset, SeekOrigin origin ) : long | ||
offset | long | |
origin | SeekOrigin | |
return | long |
public Write ( byte array, int offset, int count ) : void | ||
array | byte |
/// A |
offset | int |
/// A |
count | int |
/// A |
return | void |