C# Класс Microsoft.Deployment.Compression.Zip.CrcStream

Наследование: Stream
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
MakeCrcTable uint[]
Reflect uint
UpdateCrc void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Close() публичный Метод

Closes the underlying stream.
public Close ( ) : void
Результат void

CrcStream() публичный Метод

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.
Результат System

Flush() публичный Метод

Flushes the source stream.
public Flush ( ) : void
Результат void

Read() публичный Метод

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.
Результат int

Seek() публичный Метод

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.
Результат long

SetLength() публичный Метод

Sets the length of the source stream.
public SetLength ( long value ) : void
value long The desired length of the /// stream in bytes.
Результат void

Write() публичный Метод

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.
Результат void