Show / Hide Table of Contents

Class GZipUtility

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

Inheritance
System.Object
GZipUtility
Implements
ICompressionUtility
Namespace: GlitchedPolygons.Services.CompressionUtility
Assembly: GlitchedPolygons.Services.CompressionUtility.dll
Syntax
public class GZipUtility : object, ICompressionUtility

Methods

| Improve this Doc View Source

Compress(Byte[], CompressionSettings)

Compresses the specified bytes using and the provided CompressionSettings.

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

The byte[] array to compress.

CompressionSettings compressionSettings

The desired CompressionSettings.

Returns
Type Description
System.Byte[]

The gzipped byte[] array.

| Improve this Doc View Source

Compress(String, Encoding)

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

Declaration
public string Compress(string text, Encoding encoding = null)
Parameters
Type Name Description
System.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
System.String

The gzipped string.

| Improve this Doc View Source

Decompress(Byte[], CompressionSettings)

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

Declaration
public byte[] Decompress(byte[] gzippedBytes, CompressionSettings compressionSettings)
Parameters
Type Name Description
System.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
System.Byte[]

The decompressed bytes[].

| Improve this Doc View Source

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
System.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
System.String

The decompressed string

Implements

ICompressionUtility

See Also

ICompressionUtility
  • Improve this Doc
  • View Source
Back to top Generated by DocFX