Class StreamCompressionDecorator

    • Constructor Detail

      • StreamCompressionDecorator

        public StreamCompressionDecorator()
    • Method Detail

      • decorateWithCompression

        public final OutputStream decorateWithCompression​(OutputStream stream)
                                                   throws IOException
        Decorates the stream by wrapping it into a stream that applies a compression.

        IMPORTANT: For streams returned by this method, OutputStream.close() is not propagated to the inner stream. The inner stream must be closed separately.

        Parameters:
        stream - the stream to decorate.
        Returns:
        an output stream that is decorated by the compression scheme.
        Throws:
        IOException
      • decorateWithCompression

        public final InputStream decorateWithCompression​(InputStream stream)
                                                  throws IOException
        IMPORTANT: For streams returned by this method, InputStream.close() is not propagated to the inner stream. The inner stream must be closed separately.
        Parameters:
        stream - the stream to decorate.
        Returns:
        an input stream that is decorated by the compression scheme.
        Throws:
        IOException