Package org.apache.commons.compress.harmony.pack200

# Class Archive

java.lang.Object
org.apache.commons.compress.harmony.pack200.Archive

public class Archive extends 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.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Archive(JarFile jarFile, OutputStream outputStream, PackingOptions options)`
  Creates an Archive with the given input file and a stream for the output
  `Archive(JarInputStream inputStream, OutputStream outputStream, PackingOptions options)`
  Creates an Archive with streams for the input and output.

- ## Method Summary

  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 Details

  - ### Archive

    public Archive(JarFile jarFile, OutputStream outputStream, PackingOptions options) throws 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:
      `IOException` - If an I/O error occurs.

  - ### Archive

    public Archive(JarInputStream inputStream, OutputStream outputStream, PackingOptions options) throws 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:
      `IOException` - If an I/O error occurs.

- ## Method Details

  - ### pack

    public void pack() throws Pack200Exception, IOException
    Packs the archive.
    Throws:
      `Pack200Exception` - TODO
      `IOException` - If an I/O error occurs.