Table of Contents

Method DecompressToString

Namespace
KZDev.PerfUtils
Assembly
KZDev.PerfUtils.dll

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

source Stream

The 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

source Stream

The source stream to decompress. This stream must be readable and seekable.

encoding Encoding

The 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

source Stream

The source stream to decompress. This stream must be readable and seekable.

decompressionStreamOptions MemoryStreamSlimOptions

The 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

source Stream

The source stream to decompress. This stream must be readable and seekable.

encoding Encoding

The encoding to use to decode the decompressed data.

decompressionStreamOptions MemoryStreamSlimOptions

The 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

source Stream

The source stream to decompress. This stream must be readable and seekable.

optionsSetup Func<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

source Stream

The source stream to decompress. This stream must be readable and seekable.

encoding Encoding

The encoding to use to decode the decompressed data.

optionsSetup Func<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

source Stream

The source stream to decompress. This stream must be readable and seekable.

optionsSetup Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>

Delegate to set up options to configure the decompression operation.

setupState TState

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.

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

source Stream

The source stream to decompress. This stream must be readable and seekable.

encoding Encoding

The encoding to use to decode the decompressed data.

optionsSetup Func<MemoryStreamSlimOptions, TState, MemoryStreamSlimOptions>

Delegate to set up options to configure the decompression operation.

setupState TState

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.

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