Show / Hide Table of Contents

Class GZipUtility

Compression utility class for gzipping data. Implements the ICompressionUtility interface.

Inheritance
object
GZipUtility
Implements
ICompressionUtility
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: GlitchedPolygons.Services.CompressionUtility
Assembly: GlitchedPolygons.Services.CompressionUtility.dll
Syntax
public class GZipUtility : ICompressionUtility

Methods

Compress(byte[], CompressionSettings)

Compresses the specified bytes using GZipStream and the provided CompressionSettings.

Declaration
public byte[] Compress(byte[] bytes, CompressionSettings compressionSettings)
Parameters
Type Name Description
byte[] bytes

The byte[] array to compress.

CompressionSettings compressionSettings

The desired CompressionSettings.

Returns
Type Description
byte[]

The gzipped byte[] array.

See Also
ICompressionUtility

Compress(string, Encoding)

Compresses ("gee-zips") the specified string using GZipStream and default CompressionSettings.

Declaration
public string Compress(string text, Encoding encoding = null)
Parameters
Type Name Description
string text

The string to compress.

Encoding encoding

The encoding to use. Can be null; UTF8 will be used in that case.

Returns
Type Description
string

The gzipped string.

See Also
ICompressionUtility

Decompress(byte[], CompressionSettings)

Decompresses the specified bytes using GZipStream and the CompressionSettings that have been used to originally compress the bytes.

Declaration
public byte[] Decompress(byte[] gzippedBytes, CompressionSettings compressionSettings)
Parameters
Type Name Description
byte[] gzippedBytes

The gzipped byte[] array that you want to decompress.

CompressionSettings compressionSettings

The CompressionSettings that have been used to compress the bytes.

Returns
Type Description
byte[]

The decompressed bytes[].

See Also
ICompressionUtility

Decompress(string, Encoding)

Decompresses the specified gzipped string using the default CompressionSettings.

Declaration
public string Decompress(string gzippedString, Encoding encoding = null)
Parameters
Type Name Description
string gzippedString

The compressed string to decompress.

Encoding encoding

The encoding to use. Can be null; UTF8 will be used in that case.

Returns
Type Description
string

The decompressed string

See Also
ICompressionUtility

Implements

ICompressionUtility

See Also

ICompressionUtility
Back to top Generated by DocFX