Method DecompressToStringAsync
DecompressToStringAsync(Stream, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync(Stream source, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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.
DecompressToStringAsync(Stream, Encoding, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync(Stream source, Encoding encoding, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
encoding
EncodingThe encoding to use to decode the decompressed data.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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.
DecompressToStringAsync(Stream, MemoryStreamSlimOptions, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync(Stream source, MemoryStreamSlimOptions decompressionStreamOptions, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
decompressionStreamOptions
MemoryStreamSlimOptionsThe options that control the decompression operation. This can be used to specify the decompression type, the decompression level, and other options. If null, then default options are used.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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.
DecompressToStringAsync(Stream, Encoding, MemoryStreamSlimOptions, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync(Stream source, Encoding encoding, MemoryStreamSlimOptions decompressionStreamOptions, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
encoding
EncodingThe encoding to use to decode the decompressed data.
decompressionStreamOptions
MemoryStreamSlimOptionsThe options that control the decompression operation. This can be used to specify the decompression type, the decompression level, and other options. If null, then default options are used.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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.
DecompressToStringAsync(Stream, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync(Stream source, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions> optionsSetup, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
optionsSetup
Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>Delegate to set up the options for creating the returned MemoryStreamSlim.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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.
DecompressToStringAsync(Stream, Encoding, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync(Stream source, Encoding encoding, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions> optionsSetup, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
encoding
EncodingThe encoding to use to decode the decompressed data.
optionsSetup
Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>Delegate to set up the options for creating the returned MemoryStreamSlim.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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.
DecompressToStringAsync<TState>(Stream, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>, TState, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync<TState>(Stream source, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions> optionsSetup, TState setupState, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
optionsSetup
Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>Delegate to set up the options for creating the returned MemoryStreamSlim.
setupState
TStateState 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.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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
DecompressToStringAsync<TState>(Stream, Encoding, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>, TState, CancellationToken)
Asynchronously decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static Task<string> DecompressToStringAsync<TState>(Stream source, Encoding encoding, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions> optionsSetup, TState setupState, CancellationToken cancellationToken)
Parameters
source
StreamThe source stream to decompress. This stream must be readable and seekable.
encoding
EncodingThe encoding to use to decode the decompressed data.
optionsSetup
Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>Delegate to set up the options for creating the returned MemoryStreamSlim.
setupState
TStateState 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.
cancellationToken
CancellationTokenThe cancellation token to use for the operation.
Returns
- Task<string>
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