Compressor Compressor Compressor Compressor Class

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

Syntax

Declaration

public sealed class Compressorpublic sealed class CompressorPublic NotInheritable Class Compressorpublic sealed class Compressor

Constructors summary

Creates an instance of a compressor.

Creates an instance of a compressor.

Methods summary

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

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

Finishes writing the compression stream.

Flushes the compression stream asynchronously.

Writes information to the compression stream asynchronously.

Constructors

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

    Creates an instance of a compressor.

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

    Parameters

  • Compressor(IOutputStream, CompressAlgorithm, UInt32)
    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 New(IOutputStream underlyingStream, CompressAlgorithm algorithm, UInt32 blockSize)Public Sub New(underlyingStream As IOutputStream, algorithm As CompressAlgorithm, blockSize As UInt32)public Compressor(IOutputStream underlyingStream, CompressAlgorithm algorithm, UInt32 blockSize)

    Parameters

Methods

  • Close()
    Close()
    Close()
    Close()

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

    public void Close()public void Close()Public Function Close() As voidpublic void Close()
  • DetachStream()
    DetachStream()
    DetachStream()
    DetachStream()

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

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

    Returns

  • FinishAsync()
    FinishAsync()
    FinishAsync()
    FinishAsync()

    Finishes writing the compression stream.

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

    Returns

    • The asynchronous operation.

  • FlushAsync()
    FlushAsync()
    FlushAsync()
    FlushAsync()

    Flushes the compression stream asynchronously.

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

    Returns

    • The asynchronous operation.

  • WriteAsync(IBuffer)
    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 )public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)

    Parameters

    Returns

    • The asynchronous operation.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Storage.Compression.dll