Class Archive
java.lang.Object
org.apache.commons.compress.harmony.pack200.Archive
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
ConstructorsConstructorDescriptionArchive
(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
-
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
- target output stream for the compressed data.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
- input stream of uncompressed JAR data.outputStream
- target output stream for the compressed data.options
- packing options (if null then defaults are used).- Throws:
IOException
- If an I/O error occurs.
-
-
Method Details
-
pack
Packs the archive.- Throws:
Pack200Exception
- If a Pack200 semantic error occurs.IOException
- If an I/O error occurs.
-