A compressor which can compress and decompress data.
Compresses a source byte array and returns a compressed byte array.
| Name | Description |
|---|---|
| source | System.Byte[] The source of data to compress. |
Returns a byte array containing the compressed data.
Compresses the input stream and writes the compressed stream to the output stream.
| Name | Description |
|---|---|
| inputStream | System.IO.Stream The stream from which to read the data to be compressed. |
| outputStream | System.IO.Stream The stream into which the compressed data must be written. |
Decompresses the given source byte array and returns a decompressed byte array.
| Name | Description |
|---|---|
| source | System.Byte[] The source of data to decompress. |
Returns a byte array containing the decompressed data.
Decompresses the input stream and writes the decompressed stream to the output stream.
| Name | Description |
|---|---|
| inputStream | System.IO.Stream The stream from which to read the data to be decompressed. |
| outputStream | System.IO.Stream The stream into which the decompressed data must be written. |
A factory for generating implementations of compressor interfaces.
Creates a new instance of the compressor which matches the requested type T.
- T - The type of compressor to create.
| Name | Description |
|---|---|
| configuration | Trifling.Compression.CompressorConfiguration The configuration to use when generating the instance of the compressor. |
Returns an implementation of the compressor requested.
An implementation of a Deflate compression engine.
An implementation of a G-Zip compression engine.
A factory for creating instances of compressors.
Creates a new instance of the compressor which matches the requested type T.
- T - The type of compressor to create.
| Name | Description |
|---|---|
| configuration | Trifling.Compression.CompressorConfiguration The configuration to use when generating the instance of the compressor. |
Returns an implementation of the compressor requested.
A factory for creating instances of compressors.
Creates a new instance of the compressor which matches the requested type T.
- T - The type of compressor to create.
| Name | Description |
|---|---|
| configuration | Trifling.Compression.CompressorConfiguration The configuration to use when generating the instance of the compressor. |
Returns an implementation of the compressor requested.
A compressor which can compress and decompress data in Deflate format.
Initialises a new instance of the DeflateCompressor class with the default configuration.
Initialises a new instance of the DeflateCompressor class with the specified configuration.
| Name | Description |
|---|---|
| configuration | Microsoft.Extensions.Options.IOptions{Trifling.Compression.CompressorConfiguration} The configuration options for the compression engine. |
Initialises a new instance of the DeflateCompressor class with the specified configuration.
| Name | Description |
|---|---|
| configuration | Trifling.Compression.CompressorConfiguration The configuration options for the compression engine. |
Compresses a source byte array and returns a Deflate compressed byte array.
| Name | Description |
|---|---|
| source | System.Byte[] The source of data to compress. |
Returns a byte array containing the compressed data.
If the input byte array is smaller than the configured minimum size then the same data is returned without modification.
Compresses the input stream and writes the Deflate compressed stream to the output stream.
| Name | Description |
|---|---|
| inputStream | System.IO.Stream The stream from which to read the data to be compressed. |
| outputStream | System.IO.Stream The stream into which the compressed data must be written. |
If the input stream is shorter than the configured minimum size then the same stream data is copied to the output without modification.
Decompresses the given source Deflate byte array and returns a decompressed byte array.
| Name | Description |
|---|---|
| source | System.Byte[] The source of data to decompress. |
Returns a byte array containing the decompressed data.
If the input byte array does not contain a valid Deflate header then the same data is returned without modification.
Decompresses the input stream and writes the decompressed stream to the output stream.
| Name | Description |
|---|---|
| inputStream | System.IO.Stream The stream from which to read the data to be decompressed. |
| outputStream | System.IO.Stream The stream into which the decompressed data must be written. |
If the input stream does not contain a valid Deflate header then the same data is returned without modification.
A compressor which can compress and decompress data in G-Zip format.
Initialises a new instance of the GzipCompressor class with the default configuration.
Initialises a new instance of the GzipCompressor class with the specified configuration.
| Name | Description |
|---|---|
| configuration | Microsoft.Extensions.Options.IOptions{Trifling.Compression.CompressorConfiguration} The configuration options for the compression engine. |
Initialises a new instance of the GzipCompressor class with the specified configuration.
| Name | Description |
|---|---|
| configuration | Trifling.Compression.CompressorConfiguration The configuration options for the compression engine. |
Compresses a source byte array and returns a G-Zip compressed byte array.
| Name | Description |
|---|---|
| source | System.Byte[] The source of data to compress. |
Returns a byte array containing the compressed data.
If the input byte array is smaller than the configured minimum size then the same data is returned without modification.
Compresses the input stream and writes the G-Zip compressed stream to the output stream.
| Name | Description |
|---|---|
| inputStream | System.IO.Stream The stream from which to read the data to be compressed. |
| outputStream | System.IO.Stream The stream into which the compressed data must be written. |
If the input stream is shorter than the configured minimum size then the same stream data is copied to the output without modification.
Decompresses the given source G-Zip byte array and returns a decompressed byte array.
| Name | Description |
|---|---|
| source | System.Byte[] The source of data to decompress. |
Returns a byte array containing the decompressed data.
If the input byte array does not contain a valid G-Zip header then the same data is returned without modification.
Decompresses the input stream and writes the decompressed stream to the output stream.
| Name | Description |
|---|---|
| inputStream | System.IO.Stream The stream from which to read the data to be decompressed. |
| outputStream | System.IO.Stream The stream into which the decompressed data must be written. |
If the input stream does not contain a valid G-Zip header then the same data is returned without modification.