C# Класс CmisSync.Lib.Streams.NonClosingHashStream

This stream can be used like a CryptoStream, but does not closes/finilizes the given HashAlgorithm on dispose. Also any other operation than READ/WRITE are directly passed to the given stream.
Наследование: StreamWrapper
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
NonClosingHashStream ( Stream stream, HashAlgorithm hashAlg, CryptoStreamMode mode ) : System

Initializes a new instance of the CmisSync.Lib.Streams.NonClosingHashStream class.

Read ( byte buffer, int offset, int count ) : int

Passes the call to exact the same method of the given stream. If mode is set to Read, the given HashAlgorithm is transformed by passing the output of the read operation.

Write ( byte buffer, int offset, int count ) : void

Passes the call to exact the same method of the given stream. If mode is set to Write, the given HashAlgorithm is transformed by passing the input of the write operation.

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

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

Initializes a new instance of the CmisSync.Lib.Streams.NonClosingHashStream class.
public NonClosingHashStream ( Stream stream, HashAlgorithm hashAlg, CryptoStreamMode mode ) : System
stream Stream /// Wrapped stream. ///
hashAlg System.Security.Cryptography.HashAlgorithm /// Hash algorithm, which should be used for hash calculations. ///
mode CryptoStreamMode /// Setting the mode, when hashing should be executed. On Read will transform the hash while reading, or Write mode for transforming while writing. ///
Результат System

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

Passes the call to exact the same method of the given stream. If mode is set to Read, the given HashAlgorithm is transformed by passing the output of the read operation.
public Read ( byte buffer, int offset, int count ) : int
buffer byte /// Buffer. ///
offset int /// Offset. ///
count int /// Count. ///
Результат int

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

Passes the call to exact the same method of the given stream. If mode is set to Write, the given HashAlgorithm is transformed by passing the input of the write operation.
public Write ( byte buffer, int offset, int count ) : void
buffer byte /// Given Buffer. ///
offset int /// Given Offset. ///
count int /// Count of bytes. ///
Результат void