C# Class Microsoft.Deployment.Compression.Zip.CrcStream

Inheritance: Stream
Afficher le fichier Open project: chakrit/rambase Class Usage Examples

Private Properties

Свойство Type Description
MakeCrcTable uint[]
Reflect uint
UpdateCrc void

Méthodes publiques

Méthode 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.

Private Methods

Méthode 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.

Method Details

Close() public méthode

Closes the underlying stream.
public Close ( ) : void
Résultat void

CrcStream() public méthode

Creates a new CrcStream instance from a source stream.
public CrcStream ( Stream source ) : System
source Stream Underlying stream where bytes will be read from or written to.
Résultat System

Flush() public méthode

Flushes the source stream.
public Flush ( ) : void
Résultat void

Read() public méthode

Reads a sequence of bytes from the source stream and advances the position within the stream by the number of bytes read.
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.
Résultat int

Seek() public méthode

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.
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.
Résultat long

SetLength() public méthode

Sets the length of the source stream.
public SetLength ( long value ) : void
value long The desired length of the /// stream in bytes.
Résultat void

Write() public méthode

Writes a sequence of bytes to the source stream and advances the current position within this stream by the number of bytes written.
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.
Résultat void