Class GZipEncoding

  • All Implemented Interfaces:
    HttpEncoding

    public class GZipEncoding
    extends Object
    implements HttpEncoding
    GZip HTTP content encoding.
    Since:
    1.14
    Author:
    Yaniv Inbar
    • Constructor Detail

      • GZipEncoding

        public GZipEncoding()
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: HttpEncoding
        Returns the content encoding name (for example "gzip") or null for none.
        Specified by:
        getName in interface HttpEncoding
      • encode

        public void encode​(StreamingContent content,
                           OutputStream out)
                    throws IOException
        Description copied from interface: HttpEncoding
        Encodes the streaming content into the output stream.

        Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the the output stream has not been closed, and will fail to work if it has been closed.

        Specified by:
        encode in interface HttpEncoding
        Parameters:
        content - streaming content
        out - output stream
        Throws:
        IOException