Class Archive


  • public class Archive
    extends java.lang.Object
    Archive is the 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.
    • Field Detail

      • EMPTY_BYTE_ARRAY

        private static final byte[] EMPTY_BYTE_ARRAY
      • jarInputStream

        private final java.util.jar.JarInputStream jarInputStream
      • outputStream

        private final java.io.OutputStream outputStream
      • jarFile

        private java.util.jar.JarFile jarFile
      • currentSegmentSize

        private long currentSegmentSize
    • 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 - TODO
        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 - TODO
        outputStream - TODO
        options - packing options (if null then defaults are used)
        Throws:
        java.io.IOException - If an I/O error occurs.