Compressor 类

定义

压缩器获取写入流的信息,并使用压缩算法对其进行压缩。

public ref class Compressor sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.Storage.Compression.ICompressorFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class Compressor final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Storage.Compression.ICompressorFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class Compressor final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Storage.Compression.ICompressorFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class Compressor : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Storage.Compression.ICompressorFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class Compressor : System.IDisposable
function Compressor(underlyingStream, algorithm, blockSize)
Public NotInheritable Class Compressor
Implements IDisposable
继承
Object Platform::Object IInspectable Compressor
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

构造函数

Compressor(IOutputStream, CompressAlgorithm, UInt32)

创建压缩器实例。

Compressor(IOutputStream)

创建压缩器实例。

方法

Close()

关闭 Compressor 对象并同步放弃缓冲区中的任何信息。 这也会关闭基础流,除非已使用 Compressor.Detach 方法从对象分离流。 对已关闭对象(除外)的后续调用将失败。

DetachStream()

将基础流与 Compressor 对象分离,以便可以使用 Compressor.Close 方法关闭对象,而无需同时关闭基础流。

Dispose()

执行与释放或重置非托管资源关联的应用程序定义的任务。

FinishAsync()

完成压缩流的编写。

FlushAsync()

异步刷新压缩流。

WriteAsync(IBuffer)

以异步方式将信息写入压缩流。

适用于

另请参阅