Class GzipCompressionProvider
GZIP compression provider.
Inheritance
System.Object
GzipCompressionProvider
Implements
Namespace: Grpc.Net.Compression
Assembly: Grpc.Net.Common.dll
Syntax
public class GzipCompressionProvider : object, ICompressionProvider
Constructors
GzipCompressionProvider(CompressionLevel)
Initializes a new instance of the GzipCompressionProvider class with the specified
Declaration
public GzipCompressionProvider(CompressionLevel defaultCompressionLevel)
Parameters
Type | Name | Description |
---|---|---|
CompressionLevel | defaultCompressionLevel | The default compression level to use when compressing data. |
Properties
EncodingName
The encoding name used in the 'grpc-encoding' and 'grpc-accept-encoding' request and response headers.
Declaration
public string EncodingName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CreateCompressionStream(Stream, Nullable<CompressionLevel>)
Create a new compression stream.
Declaration
public Stream CreateCompressionStream(Stream stream, CompressionLevel? compressionLevel)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream that compressed data is written to. |
System.Nullable<CompressionLevel> | compressionLevel | The compression level. |
Returns
Type | Description |
---|---|
Stream | A stream used to compress data. |
CreateDecompressionStream(Stream)
Create a new decompression stream.
Declaration
public Stream CreateDecompressionStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream that compressed data is copied from. |
Returns
Type | Description |
---|---|
Stream | A stream used to decompress data. |