Package io.grpc

Class Codec.Gzip

  • All Implemented Interfaces:
    Codec, Compressor, Decompressor
    Enclosing interface:
    Codec

    public static final class Codec.Gzip
    extends java.lang.Object
    implements Codec
    A gzip compressor and decompressor. In the future this will likely support other compression methods, such as compression level.
    • Constructor Summary

      Constructors 
      Constructor Description
      Gzip()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.OutputStream compress​(java.io.OutputStream os)
      Wraps an existing output stream with a compressing output stream.
      java.io.InputStream decompress​(java.io.InputStream is)
      Wraps an existing input stream with a decompressing input stream.
      java.lang.String getMessageEncoding()
      Returns the message encoding that this compressor uses.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Gzip

        public Gzip()
    • Method Detail

      • getMessageEncoding

        public java.lang.String 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 interface Compressor
        Specified by:
        getMessageEncoding in interface Decompressor
      • compress

        public java.io.OutputStream compress​(java.io.OutputStream os)
                                      throws java.io.IOException
        Description copied from interface: Compressor
        Wraps an existing output stream with a compressing output stream.
        Specified by:
        compress in interface Compressor
        Parameters:
        os - The output stream of uncompressed data
        Returns:
        An output stream that compresses
        Throws:
        java.io.IOException
      • decompress

        public java.io.InputStream decompress​(java.io.InputStream is)
                                       throws java.io.IOException
        Description copied from interface: Decompressor
        Wraps an existing input stream with a decompressing input stream.
        Specified by:
        decompress in interface Decompressor
        Parameters:
        is - The input stream of uncompressed data
        Returns:
        An input stream that decompresses
        Throws:
        java.io.IOException