Delen via


Compressor Class

Definition

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

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
Inheritance
Object Platform::Object IInspectable 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

See also