Class Pack200CompressorOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class Pack200CompressorOutputStream
    extends CompressorOutputStream
    An output stream that compresses using the Pack200 format.
    Since:
    1.3
    • Constructor Summary

      Constructors 
      Constructor Description
      Pack200CompressorOutputStream​(java.io.OutputStream out)
      Compresses the given stream, caching the compressed data in memory.
      Pack200CompressorOutputStream​(java.io.OutputStream out, java.util.Map<java.lang.String,​java.lang.String> props)
      Compresses the given stream, caching the compressed data in memory and using the given properties.
      Pack200CompressorOutputStream​(java.io.OutputStream out, Pack200Strategy mode)
      Compresses the given stream using the given strategy to cache the results.
      Pack200CompressorOutputStream​(java.io.OutputStream out, Pack200Strategy mode, java.util.Map<java.lang.String,​java.lang.String> props)
      Compresses the given stream using the given strategy to cache the results and the given properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void finish()  
      void write​(byte[] b)  
      void write​(byte[] b, int from, int length)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        flush, nullOutputStream
      • Methods inherited from class java.lang.Object

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

      • Pack200CompressorOutputStream

        public Pack200CompressorOutputStream​(java.io.OutputStream out)
                                      throws java.io.IOException
        Compresses the given stream, caching the compressed data in memory.
        Parameters:
        out - the stream to write to
        Throws:
        java.io.IOException - if writing fails
      • Pack200CompressorOutputStream

        public Pack200CompressorOutputStream​(java.io.OutputStream out,
                                             Pack200Strategy mode)
                                      throws java.io.IOException
        Compresses the given stream using the given strategy to cache the results.
        Parameters:
        out - the stream to write to
        mode - the strategy to use
        Throws:
        java.io.IOException - if writing fails
      • Pack200CompressorOutputStream

        public Pack200CompressorOutputStream​(java.io.OutputStream out,
                                             java.util.Map<java.lang.String,​java.lang.String> props)
                                      throws java.io.IOException
        Compresses the given stream, caching the compressed data in memory and using the given properties.
        Parameters:
        out - the stream to write to
        props - Pack200 properties to use
        Throws:
        java.io.IOException - if writing fails
      • Pack200CompressorOutputStream

        public Pack200CompressorOutputStream​(java.io.OutputStream out,
                                             Pack200Strategy mode,
                                             java.util.Map<java.lang.String,​java.lang.String> props)
                                      throws java.io.IOException
        Compresses the given stream using the given strategy to cache the results and the given properties.
        Parameters:
        out - the stream to write to
        mode - the strategy to use
        props - Pack200 properties to use
        Throws:
        java.io.IOException - if writing fails
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int from,
                          int length)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException
      • finish

        public void finish()
                    throws java.io.IOException
        Throws:
        java.io.IOException