Method DecompressAsync
DecompressAsync(Stream, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new MemoryStreamSlim instance containing the decompressed data.
public static Task<MemoryStreamSlim> DecompressAsync(Stream source, CancellationToken cancellationToken)Parameters
- sourceStream
- The source stream to decompress. This stream must be readable and seekable. 
- cancellationTokenCancellationToken
- The cancellation token to use for the operation. 
Returns
- Task<MemoryStreamSlim>
- An awaitable task that completes when the operation is complete and returns a new MemoryStreamSlim instance containing the compressed data from the source stream using the specified decompression type. If the source stream is empty, an empty MemoryStreamSlim instance is returned. 
DecompressAsync(Stream, MemoryStreamSlimOptions, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new MemoryStreamSlim instance containing the decompressed data.
public static Task<MemoryStreamSlim> DecompressAsync(Stream source, MemoryStreamSlimOptions decompressionStreamOptions, CancellationToken cancellationToken)Parameters
- sourceStream
- The source stream to decompress. This stream must be readable and seekable. 
- decompressionStreamOptionsMemoryStreamSlimOptions
- The options used for creating the returned MemoryStreamSlim. 
- cancellationTokenCancellationToken
- The cancellation token to use for the operation. 
Returns
- Task<MemoryStreamSlim>
- An awaitable task that completes when the operation is complete and returns a new MemoryStreamSlim instance containing the compressed data from the source stream using the specified decompression type. If the source stream is empty, an empty MemoryStreamSlim instance is returned. 
DecompressAsync(Stream, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new MemoryStreamSlim instance containing the decompressed data.
public static Task<MemoryStreamSlim> DecompressAsync(Stream source, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions> optionsSetup, CancellationToken cancellationToken)Parameters
- sourceStream
- The source stream to decompress. This stream must be readable and seekable. 
- optionsSetupFunc<MemoryStreamSlimOptions, MemoryStreamSlimOptions>
- Delegate to set up the options for creating the returned MemoryStreamSlim. 
- cancellationTokenCancellationToken
- The cancellation token to use for the operation. 
Returns
- Task<MemoryStreamSlim>
- An awaitable task that completes when the operation is complete and returns a new MemoryStreamSlim instance containing the compressed data from the source stream using the specified decompression type. If the source stream is empty, an empty MemoryStreamSlim instance is returned. 
DecompressAsync<TState>(Stream, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>, TState, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new MemoryStreamSlim instance containing the decompressed data.
public static Task<MemoryStreamSlim> DecompressAsync<TState>(Stream source, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions> optionsSetup, TState setupState, CancellationToken cancellationToken)Parameters
- sourceStream
- The source stream to decompress. This stream must be readable and seekable. 
- optionsSetupFunc<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>
- Delegate to set up the options for creating the returned MemoryStreamSlim. 
- setupStateTState
- State object to pass to the options setup delegate. This can be used to pass any type of state information to the delegate and avoid the need for a closure. 
- cancellationTokenCancellationToken
- The cancellation token to use for the operation. 
Returns
- Task<MemoryStreamSlim>
- An awaitable task that completes when the operation is complete and returns a new MemoryStreamSlim instance containing the compressed data from the source stream using the specified decompression type. If the source stream is empty, an empty MemoryStreamSlim instance is returned. 
Type Parameters
- TState