Compressor Compressor Compressor Class

Definition

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

public sealed class Compressor : IClosable, ICompressor, IOutputStreampublic sealed class Compressor : IDisposable, ICompressor, IOutputStreamPublic NotInheritable Class Compressor Implements IDisposable, ICompressor, IOutputStream
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

Compressor(IOutputStream) Compressor(IOutputStream) Compressor(IOutputStream)

Creates an instance of a compressor.

public Compressor(IOutputStream underlyingStream)public Compressor(IOutputStream underlyingStream)Public Sub New(underlyingStream As IOutputStream)
Parameters
underlyingStream
IOutputStream IOutputStream IOutputStream

The stream of compressed information to be written by the compressor.

Attributes

Compressor(IOutputStream, CompressAlgorithm, UInt32) Compressor(IOutputStream, CompressAlgorithm, UInt32) Compressor(IOutputStream, CompressAlgorithm, UInt32)

Creates an instance of a compressor.

public Compressor(IOutputStream underlyingStream, CompressAlgorithm algorithm, UInt32 blockSize)public Compressor(IOutputStream underlyingStream, CompressAlgorithm algorithm, UInt32 blockSize)Public Sub New(underlyingStream As IOutputStream, algorithm As CompressAlgorithm, blockSize As UInt32)
Parameters
underlyingStream
IOutputStream IOutputStream IOutputStream

The stream of compressed information to be written by the compressor.

algorithm
CompressAlgorithm CompressAlgorithm CompressAlgorithm

The compression algorithm used by the compressor to write underlyingStream.

blockSize
System.UInt32 System.UInt32 System.UInt32

Size in bytes of the intermediate buffer used by the compression algorithm. A value of 0 specifies that the compression algorithm will use its default block size. Valid non-zero values for this parameter are 32Kb to 64Mb.

Attributes

Methods

Close() Close() 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.

public void Close()This member is not implemented in C#This member is not implemented in VB.Net
Attributes

DetachStream() DetachStream() 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.

public IOutputStream DetachStream()public IOutputStream DetachStream()Public Function DetachStream() As IOutputStream
Returns

The stream of information.

Attributes

Dispose() Dispose() Dispose()

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

This member is not implemented in C++void Dispose()Sub Dispose
Attributes

FinishAsync() FinishAsync() FinishAsync()

Finishes writing the compression stream.

public IAsyncOperation<bool> FinishAsync()public IAsyncOperation<bool> FinishAsync()Public Function FinishAsync() As IAsyncOperation( Of bool )
Returns

The asynchronous operation.

Attributes

FlushAsync() FlushAsync() FlushAsync()

Flushes the compression stream asynchronously.

public IAsyncOperation<bool> FlushAsync()public IAsyncOperation<bool> FlushAsync()Public Function FlushAsync() As IAsyncOperation( Of bool )
Returns

The asynchronous operation.

Attributes

WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer)

Writes information to the compression stream asynchronously.

public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)Public Function WriteAsync(buffer As IBuffer) As IAsyncOperationWithProgress( Of uint, uint )
Parameters
buffer
IBuffer IBuffer IBuffer

The buffer that contains the information to be written to the stream.

Returns

The asynchronous operation.

Attributes