java.lang.Object
kala.compress.harmony.pack200.Archive
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate static final byte[]private JarFileprivate final JarInputStreamprivate final PackingOptionsprivate final OutputStream -
Constructor Summary
ConstructorsConstructorDescriptionArchive(JarFile jarFile, OutputStream outputStream, PackingOptions options) Creates an Archive with the given input file and a stream for the outputArchive(JarInputStream inputStream, OutputStream outputStream, PackingOptions options) Creates an Archive with streams for the input and output. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanaddJarEntry(Archive.PackingFile packingFile, List<Pack200ClassReader> javaClasses, List<Archive.PackingFile> files) private voidprivate voidprivate longestimateSize(Archive.PackingFile packingFile) voidpack()Packs the archive.private List<Archive.SegmentUnit> splitIntoSegments(List<Archive.PackingFile> packingFileList)
-
Field Details
-
EMPTY_BYTE_ARRAY
private static final byte[] EMPTY_BYTE_ARRAY -
jarInputStream
-
outputStream
-
jarFile
-
currentSegmentSize
private long currentSegmentSize -
options
-
-
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 fileoutputStream- TODOoptions- 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- TODOoutputStream- TODOoptions- packing options (if null then defaults are used)- Throws:
IOException- If an I/O error occurs.
-
-
Method Details
-
addJarEntry
private boolean addJarEntry(Archive.PackingFile packingFile, List<Pack200ClassReader> javaClasses, List<Archive.PackingFile> files) -
doNormalPack
- Throws:
IOExceptionPack200Exception
-
doZeroEffortPack
- Throws:
IOException
-
estimateSize
-
pack
Packs the archive.- Throws:
Pack200Exception- TODOIOException- If an I/O error occurs.
-
splitIntoSegments
-