Class Archive


  • public class Archive
    extends java.lang.Object
    Main entry point to pack200 and represents a packed archive. An archive is constructed with either a JarInputStream and an output stream or a JarFile as input and an OutputStream. Options can be set, then pack() is called, to pack the Jar file into a pack200 archive.
    • Constructor Summary

      Constructors 
      Constructor Description
      Archive​(java.util.jar.JarFile jarFile, java.io.OutputStream outputStream, PackingOptions options)
      Creates an Archive with the given input file and a stream for the output.
      Archive​(java.util.jar.JarInputStream inputStream, java.io.OutputStream outputStream, PackingOptions options)
      Creates an Archive with streams for the input and output.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void pack()
      Packs the archive.
      • Methods inherited from class java.lang.Object

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

      • Archive

        public Archive​(java.util.jar.JarFile jarFile,
                       java.io.OutputStream outputStream,
                       PackingOptions options)
                throws java.io.IOException
        Creates an Archive with the given input file and a stream for the output.
        Parameters:
        jarFile - the input file.
        outputStream - target output stream for the compressed data.
        options - packing options (if null then defaults are used).
        Throws:
        java.io.IOException - If an I/O error occurs.
      • Archive

        public Archive​(java.util.jar.JarInputStream inputStream,
                       java.io.OutputStream outputStream,
                       PackingOptions options)
                throws java.io.IOException
        Creates an Archive with streams for the input and output.
        Parameters:
        inputStream - input stream of uncompressed JAR data.
        outputStream - target output stream for the compressed data.
        options - packing options (if null then defaults are used).
        Throws:
        java.io.IOException - If an I/O error occurs.
    • Method Detail

      • pack

        public void pack()
                  throws Pack200Exception,
                         java.io.IOException
        Packs the archive.
        Throws:
        Pack200Exception - If a Pack200 semantic error occurs.
        java.io.IOException - If an I/O error occurs.