Property | Type | Description | |
---|---|---|---|
MakeCrcTable | uint[] | ||
Reflect | uint | ||
UpdateCrc | void |
Method | Description | |
---|---|---|
Close ( ) : void |
Closes the underlying stream.
|
|
CrcStream ( Stream source ) : System |
Creates a new CrcStream instance from a source stream.
|
|
Flush ( ) : void |
Flushes the source stream.
|
|
Read ( byte buffer, int offset, int count ) : int |
Reads a sequence of bytes from the source stream and advances the position within the stream by the number of bytes read.
|
|
Seek ( long offset, SeekOrigin origin ) : long |
Sets the position within the source stream. Note the CRC is only calculated over bytes that are actually read or written, so any bytes skipped by seeking will not contribute to the CRC. |
|
SetLength ( long value ) : void |
Sets the length of the source stream.
|
|
Write ( byte buffer, int offset, int count ) : void |
Writes a sequence of bytes to the source stream and advances the current position within this stream by the number of bytes written.
|
Method | Description | |
---|---|---|
MakeCrcTable ( ) : uint[] |
Computes a table that speeds up calculation of the CRC.
|
|
Reflect ( uint value, int bits ) : uint |
Reflects the ordering of certain number of bits. For exmample when reflecting one byte, bit one is swapped with bit eight, bit two with bit seven, etc.
|
|
UpdateCrc ( byte buffer, int offset, int count ) : void |
Updates the CRC with a range of bytes that were read or written.
|
public CrcStream ( Stream source ) : System | ||
source | Stream | Underlying stream where bytes will be read from or written to. |
return | System |
public Read ( byte buffer, int offset, int count ) : int | ||
buffer | byte | An array of bytes. When this method returns, the buffer /// contains the specified byte array with the values between offset and /// (offset + count - 1) replaced by the bytes read from the current source. |
offset | int | The zero-based byte offset in buffer at which to begin /// storing the data read from the current stream. |
count | int | The maximum number of bytes to be read from the current stream. |
return | int |
public Seek ( long offset, SeekOrigin origin ) : long | ||
offset | long | A byte offset relative to the origin parameter. |
origin | SeekOrigin | A value of type SeekOrigin indicating /// the reference point used to obtain the new position. |
return | long |
public SetLength ( long value ) : void | ||
value | long | The desired length of the /// stream in bytes. |
return | void |
public Write ( byte buffer, int offset, int count ) : void | ||
buffer | byte | An array of bytes. This method copies count /// bytes from buffer to the current stream. |
offset | int | The zero-based byte offset in buffer at which /// to begin copying bytes to the current stream. |
count | int | The number of bytes to be written to the /// current stream. |
return | void |