BrotliStream 類別

定義

提供使用 Brotli 資料格式規格來壓縮和解壓縮資料流的方法和屬性。Provides methods and properties used to compress and decompress streams by using the Brotli data format specification.

public ref class BrotliStream sealed : System::IO::Stream
public sealed class BrotliStream : System.IO.Stream
type BrotliStream = class
    inherit Stream
Public NotInheritable Class BrotliStream
Inherits Stream
繼承
BrotliStream

建構函式

BrotliStream(Stream, CompressionLevel)

使用指定的資料流和壓縮層級,初始化 BrotliStream 類別的新執行個體。Initializes a new instance of the BrotliStream class by using the specified stream and compression level.

BrotliStream(Stream, CompressionLevel, Boolean)

使用指定的資料流和壓縮層級,初始化 BrotliStream 類別的新執行個體,並選擇性地保持開啟資料流。Initializes a new instance of the BrotliStream class by using the specified stream and compression level, and optionally leaves the stream open.

BrotliStream(Stream, CompressionMode)

使用指定的資料流和壓縮模式,初始化 BrotliStream 類別的新執行個體。Initializes a new instance of the BrotliStream class by using the specified stream and compression mode.

BrotliStream(Stream, CompressionMode, Boolean)

使用指定的資料流和壓縮模式,初始化 BrotliStream 類別的新執行個體,並選擇性地保持開啟資料流。Initializes a new instance of the BrotliStream class by using the specified stream and compression mode, and optionally leaves the stream open.

屬性

BaseStream

取得基礎資料流的參考。Gets a reference to the underlying stream.

CanRead

取得值,指出在解壓縮檔案時,資料流是否支援讀取。Gets a value indicating whether the stream supports reading while decompressing a file.

CanSeek

取得值,指出資料流是否支援搜尋。Gets a value indicating whether the stream supports seeking.

CanTimeout

取得值,該值判斷目前的資料流是否可以逾時。Gets a value that determines whether the current stream can time out.

(繼承來源 Stream)
CanWrite

取得值,指出資料流是否支援寫入。Gets a value indicating whether the stream supports writing.

Length

這個屬性不受支援,而且一律會擲回 NotSupportedExceptionThis property is not supported and always throws a NotSupportedException.

Position

這個屬性不受支援,而且一律會擲回 NotSupportedExceptionThis property is not supported and always throws a NotSupportedException.

ReadTimeout

取得或設定值 (以毫秒為單位),該值決定資料流在逾時前將嘗試讀取多長時間。Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.

(繼承來源 Stream)
WriteTimeout

取得或設定毫秒值,該值決定在逾時前資料流將嘗試寫入多長時間。Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.

(繼承來源 Stream)

方法

BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

開始非同步的讀取作業。Begins an asynchronous read operation. (請考慮使用 ReadAsync(Byte[], Int32, Int32) 方法替代。)(Consider using the ReadAsync(Byte[], Int32, Int32) method instead.)

BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)

開始非同步的寫入作業。Begins an asynchronous write operation. (請考慮使用 WriteAsync(Byte[], Int32, Int32) 方法替代。)(Consider using the WriteAsync(Byte[], Int32, Int32) method instead.)

Close()

關閉目前資料流和釋放與目前資料流相關聯的任何資源 (例如通訊端和檔案控制代碼)。Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. 請確定正確地處置資料流,而非呼叫這個方法。Instead of calling this method, ensure that the stream is properly disposed.

(繼承來源 Stream)
CopyTo(Stream)

從目前資料流讀取位元組,並將其寫入另一個資料流中。Reads the bytes from the current stream and writes them to another stream.

(繼承來源 Stream)
CopyTo(Stream, Int32)

使用指定的緩衝區大小,從目前資料流讀取所有位元組,並將其寫入另一個資料流中。Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.

(繼承來源 Stream)
CopyToAsync(Stream)

以非同步的方式從目前資料流讀取所有位元組,並將其寫入另一個資料流中。Asynchronously reads the bytes from the current stream and writes them to another stream.

(繼承來源 Stream)
CopyToAsync(Stream, CancellationToken)

使用指定的取消權杖,以非同步的方式從目前資料流讀取位元組,並將其寫入另一個資料流。Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified cancellation token.

(繼承來源 Stream)
CopyToAsync(Stream, Int32)

使用指定的緩衝區大小,以非同步的方式從目前資料流讀取所有位元組,並將其寫入另一個資料流中。Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size.

(繼承來源 Stream)
CopyToAsync(Stream, Int32, CancellationToken)

使用指定的緩衝區大小和取消語彙基元,以非同步的方式從目前資料流讀取位元組,並將其寫入另一個資料流。Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.

(繼承來源 Stream)
CreateWaitHandle()

配置 WaitHandle 物件。Allocates a WaitHandle object.

(繼承來源 Stream)
Dispose()

釋出 Stream 所使用的全部資源。Releases all resources used by the Stream.

(繼承來源 Stream)
Dispose(Boolean)

釋放 Stream 所使用的 unmanaged 資源並選擇性地釋放 managed 的資源。Releases the unmanaged resources used by the Stream and optionally releases the managed resources.

(繼承來源 Stream)
DisposeAsync()

以非同步方式釋放 BrotliStream 使用的不受控資源。Asynchronously releases the unmanaged resources used by the BrotliStream.

EndRead(IAsyncResult)

等候暫止的非同步讀取完成。Waits for the pending asynchronous read to complete. (請考慮使用 ReadAsync(Byte[], Int32, Int32) 方法替代。)(Consider using the ReadAsync(Byte[], Int32, Int32) method instead.)

EndWrite(IAsyncResult)

處理非同步寫入作業的結束。Handles the end of an asynchronous write operation. (請考慮使用 WriteAsync(Byte[], Int32, Int32) 方法替代。)(Consider using the WriteAsync(Byte[], Int32, Int32) method instead.)

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Flush()

這個方法目前的實作沒有任何功能。The current implementation of this method has no functionality.

FlushAsync()

以非同步的方式清除這個資料流的所有緩衝區,並造成所有緩衝資料都寫入基礎裝置。Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.

(繼承來源 Stream)
FlushAsync(CancellationToken)

以非同步方式清除這個 Brotli 資料流的所有緩衝區、讓所有緩衝資料全部寫入基礎裝置,並監視取消要求。Asynchronously clears all buffers for this Brotli stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ObjectInvariant()

提供 Contract 的支援。Provides support for a Contract.

(繼承來源 Stream)
Read(Byte[], Int32, Int32)

將大量解壓縮的位元組讀入指定的位元組陣列。Reads a number of decompressed bytes into the specified byte array.

Read(Span<Byte>)

將位元組序列從目前 Brotli 資料流讀取到位元組範圍,並依讀取的位元組數將 Brotli 資料流中位置往前移。Reads a sequence of bytes from the current Brotli stream to a byte span and advances the position within the Brotli stream by the number of bytes read.

ReadAsync(Byte[], Int32, Int32)

以非同步的方式從目前的資料流讀取位元組序列,並依讀取的位元組數將資料流中的位置往前移。Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

(繼承來源 Stream)
ReadAsync(Byte[], Int32, Int32, CancellationToken)

以非同步方式從目前 Brotli 資料流讀取位元組序列、將其寫入至起始於指定索引的位元組陣列、依讀取的位元組數將 Brotli 資料流中位置往前移,並監視取消要求。Asynchronously reads a sequence of bytes from the current Brotli stream, writes them to a byte array starting at a specified index, advances the position within the Brotli stream by the number of bytes read, and monitors cancellation requests.

ReadAsync(Memory<Byte>, CancellationToken)

以非同步方式從目前 Brotli 資料流讀取位元組序列、將其寫入至位元組記憶體範圍、依讀取的位元組數將 Brotli 資料流中位置往前移,並監視取消要求。Asynchronously reads a sequence of bytes from the current Brotli stream, writes them to a byte memory range, advances the position within the Brotli stream by the number of bytes read, and monitors cancellation requests.

ReadByte()

從資料流讀取一個位元組,並將資料流的位置推進一個位元組;如果在資料流末端,則傳回 -1。Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

(繼承來源 Stream)
Seek(Int64, SeekOrigin)

這個屬性不受支援,而且一律會擲回 NotSupportedExceptionThis property is not supported and always throws a NotSupportedException.

SetLength(Int64)

這個屬性不受支援,而且一律會擲回 NotSupportedExceptionThis property is not supported and always throws a NotSupportedException.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
Write(Byte[], Int32, Int32)

從指定的位元組陣列將壓縮的位元組寫入基礎資料流。Writes compressed bytes to the underlying stream from the specified byte array.

Write(ReadOnlySpan<Byte>)

將位元組序列從唯讀位元組範圍寫入至目前 Brotli 資料流,並依寫入的位元組數將此 Brotli 資料流中目前位置往前移。Writes a sequence of bytes to the current Brotli stream from a read-only byte span and advances the current position within this Brotli stream by the number of bytes written.

WriteAsync(Byte[], Int32, Int32)

以非同步的方式將位元組序列寫入至目前的資料流,並依寫入的位元組數將資料流中目前的位置往前移。Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

(繼承來源 Stream)
WriteAsync(Byte[], Int32, Int32, CancellationToken)

以非同步方式從所指定位元組陣列將壓縮的位元組寫入至基礎 Brotli 資料流。Asynchronously writes compressed bytes to the underlying Brotli stream from the specified byte array.

WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

以非同步方式從所指定位元組記憶體範圍將壓縮的位元組寫入至基礎 Brotli 資料流。Asynchronously writes compressed bytes to the underlying Brotli stream from the specified byte memory range.

WriteByte(Byte)

寫入一個位元組至資料流的目前位置,並將資料流位置推進一個位元組。Writes a byte to the current position in the stream and advances the position within the stream by one byte.

(繼承來源 Stream)

明確介面實作

IDisposable.Dispose()

釋出 Stream 所使用的全部資源。Releases all resources used by the Stream.

(繼承來源 Stream)

適用於