Package io.grpc
Class Codec.Gzip
java.lang.Object
io.grpc.Codec.Gzip
- All Implemented Interfaces:
Codec
,Compressor
,Decompressor
- Enclosing interface:
Codec
A gzip compressor and decompressor. In the future this will likely support other
compression methods, such as compression level.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.grpc.Codec
Codec.Gzip, Codec.Identity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompress
(OutputStream os) Wraps an existing output stream with a compressing output stream.Wraps an existing input stream with a decompressing input stream.Returns the message encoding that this compressor uses.
-
Constructor Details
-
Gzip
public Gzip()
-
-
Method Details
-
getMessageEncoding
Description copied from interface:Compressor
Returns the message encoding that this compressor uses.This can be values such as "gzip", "deflate", "snappy", etc.
- Specified by:
getMessageEncoding
in interfaceCompressor
- Specified by:
getMessageEncoding
in interfaceDecompressor
-
compress
Description copied from interface:Compressor
Wraps an existing output stream with a compressing output stream.- Specified by:
compress
in interfaceCompressor
- Parameters:
os
- The output stream of uncompressed data- Returns:
- An output stream that compresses
- Throws:
IOException
-
decompress
Description copied from interface:Decompressor
Wraps an existing input stream with a decompressing input stream.- Specified by:
decompress
in interfaceDecompressor
- Parameters:
is
- The input stream of uncompressed data- Returns:
- An input stream that decompresses
- Throws:
IOException
-