Class OdfCrc32Stream
Wraps a stream and computes a running CRC-32 checksum while bytes are read or written. 包裝資料流,並在讀取或寫入位元組時即時計算累積的 CRC-32 校驗碼。
public sealed class OdfCrc32Stream : Stream, IDisposable, IAsyncDisposable
- Inheritance
-
OdfCrc32Stream
- Implements
- Inherited Members
Constructors
OdfCrc32Stream(Stream)
Short overload of OdfCrc32Stream that accepts underlyingStream; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 underlyingStream;其餘可選參數使用預設值並轉呼叫最長 OdfCrc32Stream 多載。
public OdfCrc32Stream(Stream underlyingStream)
Parameters
underlyingStreamStream
OdfCrc32Stream(Stream, uint?)
Initializes a new instance of the OdfCrc32Stream class. 初始化 OdfCrc32Stream 類別的新執行個體。
public OdfCrc32Stream(Stream underlyingStream, uint? expectedCrc)
Parameters
underlyingStreamStreamThe stream to wrap. / 要包裝的資料流。
expectedCrcuint?The optional expected CRC-32 value to verify at end of stream. / 選用的預期 CRC-32 值,會在讀取至結尾時驗證。
Properties
CanRead
Provides the CanRead member. 提供 CanRead 成員。
public override bool CanRead { get; }
Property Value
CanSeek
Provides the CanSeek member. 提供 CanSeek 成員。
public override bool CanSeek { get; }
Property Value
CanWrite
Provides the CanWrite member. 提供 CanWrite 成員。
public override bool CanWrite { get; }
Property Value
Crc32
Gets the current CRC-32 value computed so far. 取得目前為止計算出的 CRC-32 值。
public uint Crc32 { get; }
Property Value
Length
Provides the Length member. 提供 Length 成員。
public override long Length { get; }
Property Value
Position
Gets or sets the current position of the underlying stream. 取得或設定底層資料流的目前位置。
public override long Position { get; set; }
Property Value
Methods
Dispose(bool)
Releases unmanaged resources. 釋放非受控資源。
protected override void Dispose(bool disposing)
Parameters
disposingbool
Flush()
Performs flush. 執行 Flush。
public override void Flush()
Read(byte[], int, int)
Performs the Read operation. 執行 Read 作業。
public override int Read(byte[] buffer, int offset, int count)
Parameters
Returns
Seek(long, SeekOrigin)
Performs seek. 執行 Seek。
public override long Seek(long offset, SeekOrigin origin)
Parameters
offsetlongoriginSeekOrigin
Returns
SetLength(long)
Sets length. 設定 Length。
public override void SetLength(long value)
Parameters
valuelong
Write(byte[], int, int)
Performs the Write operation. 執行 Write 作業。
public override void Write(byte[] buffer, int offset, int count)