Method DecompressToString
DecompressToString(Stream)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString(Stream source)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
Returns
- string
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.
DecompressToString(Stream, Encoding)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString(Stream source, Encoding encoding)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
encodingEncodingThe encoding to use to decode the decompressed data.
Returns
- string
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.
DecompressToString(Stream, MemoryStreamSlimOptions)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString(Stream source, MemoryStreamSlimOptions decompressionStreamOptions)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
decompressionStreamOptionsMemoryStreamSlimOptionsThe options used for creating the returned MemoryStreamSlim.
Returns
- string
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.
DecompressToString(Stream, Encoding, MemoryStreamSlimOptions)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString(Stream source, Encoding encoding, MemoryStreamSlimOptions decompressionStreamOptions)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
encodingEncodingThe encoding to use to decode the decompressed data.
decompressionStreamOptionsMemoryStreamSlimOptionsThe 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.
Returns
- string
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.
DecompressToString(Stream, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString(Stream source, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions> optionsSetup)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
optionsSetupFunc<MemoryStreamSlimOptions, MemoryStreamSlimOptions>Delegate to set up options to configure the decompression operation.
Returns
- string
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.
DecompressToString(Stream, Encoding, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions>)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString(Stream source, Encoding encoding, Func<MemoryStreamSlimOptions, MemoryStreamSlimOptions> optionsSetup)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
encodingEncodingThe encoding to use to decode the decompressed data.
optionsSetupFunc<MemoryStreamSlimOptions, MemoryStreamSlimOptions>Delegate to set up options to configure the decompression operation.
Returns
- string
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.
DecompressToString<TState>(Stream, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>, TState)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString<TState>(Stream source, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions> optionsSetup, TState setupState)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
optionsSetupFunc<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>Delegate to set up options to configure the decompression operation.
setupStateTStateState 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.
Returns
- string
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
DecompressToString<TState>(Stream, Encoding, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>, TState)
Decompresses the data in the source stream and returns a new string instance containing the decompressed data decoded with UTF-8.
public static string DecompressToString<TState>(Stream source, Encoding encoding, Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions> optionsSetup, TState setupState)
Parameters
sourceStreamThe source stream to decompress. This stream must be readable and seekable.
encodingEncodingThe encoding to use to decode the decompressed data.
optionsSetupFunc<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>Delegate to set up options to configure the decompression operation.
setupStateTStateState 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.
Returns
- string
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