Class Archive
- java.lang.Object
-
- org.apache.commons.compress.harmony.pack200.Archive
-
public class Archive extends java.lang.Object
Main entry point to pack200 and represents a packed archive. An archive is constructed with either aJarInputStreamand an output stream or aJarFileas input and an OutputStream. Options can be set, thenpack()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 voidpack()Packs the archive.
-
-
-
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.
-
-