Share via


Compressor Class

Definition

A compressor takes information written to a stream and compresses it using a compression algorithm.

[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
Inheritance
Object Compressor
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Constructors

Compressor(IOutputStream, CompressAlgorithm, UInt32)

Creates an instance of a compressor.

Compressor(IOutputStream)

Creates an instance of a compressor.

Methods

Close()

Closes a Compressor object and synchronously discards any information in buffers. This will close the underlying stream as well unless the Compressor.Detach method has been used to detach the stream from the object. Subsequent calls on a closed object, except for , will fail.

DetachStream()

Detaches the underlying stream from the Compressor object so that the object can be closed using the Compressor.Close method without also closing the underlying stream.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FinishAsync()

Finishes writing the compression stream.

FlushAsync()

Flushes the compression stream asynchronously.

WriteAsync(IBuffer)

Writes information to the compression stream asynchronously.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also