Package io.grpc
Interface Compressor
-
- All Known Subinterfaces:
Codec
- All Known Implementing Classes:
Codec.Gzip
,Codec.Identity
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") public interface Compressor
Represents a message compressor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStream
compress(OutputStream os)
Wraps an existing output stream with a compressing output stream.String
getMessageEncoding()
Returns the message encoding that this compressor uses.
-
-
-
Method Detail
-
getMessageEncoding
String getMessageEncoding()
Returns the message encoding that this compressor uses.This can be values such as "gzip", "deflate", "snappy", etc.
-
compress
OutputStream compress(OutputStream os) throws IOException
Wraps an existing output stream with a compressing output stream.- Parameters:
os
- The output stream of uncompressed data- Returns:
- An output stream that compresses
- Throws:
IOException
-
-