Package java.util.jar
Interface Pack200.Packer
- Enclosing class:
- Pack200
public static interface Pack200.Packer
The interface defining the API for converting a JAR file to an output
stream in the Pack200 format.
-
Field Summary
Fields Modifier and Type Field Description static StringCLASS_ATTRIBUTE_PFXthe format of a class attribute name.static StringCODE_ATTRIBUTE_PFXthe format of a code attribute name.static StringDEFLATE_HINTthe deflation hint to set in the output archive.static StringEFFORTthe indicated amount of effort to use in compressing the archive.static StringERRORa String representation forerror.static StringFALSEa String representation offalse.static StringFIELD_ATTRIBUTE_PFXthe format of a field attribute name.static StringKEEPa String representation forkeep.static StringKEEP_FILE_ORDERdecide if all elements shall transmit in their original order.static StringLATESTa String representation forlatest.static StringMETHOD_ATTRIBUTE_PFXthe format of a method attribute name.static StringMODIFICATION_TIMEif it shall attempt to determine the latest modification time if this is set toLATEST.static StringPASSa String representation ofpass.static StringPASS_FILE_PFXthe file that will not be compressed.static StringPROGRESSpacker progress as a percentage.static StringSEGMENT_LIMITThe number of bytes of each archive segment.static StringSTRIPa String representation ofstrip.static StringTRUEa String representation oftrue.static StringUNKNOWN_ATTRIBUTEthe action to take if an unknown attribute is encountered. -
Method Summary
Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)add a listener for PropertyChange eventsvoidpack(JarFile in, OutputStream out)Pack the specified JAR file to the specified output stream.voidpack(JarInputStream in, OutputStream out)Pack the data from the specified jar input stream to the specified output stream.SortedMap<String,String>properties()Returns a sorted map of the properties of this packer.voidremovePropertyChangeListener(PropertyChangeListener listener)remove a listener
-
Field Details
-
CLASS_ATTRIBUTE_PFX
the format of a class attribute name.- See Also:
- Constant Field Values
-
CODE_ATTRIBUTE_PFX
the format of a code attribute name.- See Also:
- Constant Field Values
-
DEFLATE_HINT
the deflation hint to set in the output archive.- See Also:
- Constant Field Values
-
EFFORT
the indicated amount of effort to use in compressing the archive.- See Also:
- Constant Field Values
-
ERROR
a String representation forerror.- See Also:
- Constant Field Values
-
FALSE
a String representation offalse.- See Also:
- Constant Field Values
-
FIELD_ATTRIBUTE_PFX
the format of a field attribute name.- See Also:
- Constant Field Values
-
KEEP
a String representation forkeep.- See Also:
- Constant Field Values
-
KEEP_FILE_ORDER
decide if all elements shall transmit in their original order.- See Also:
- Constant Field Values
-
LATEST
a String representation forlatest.- See Also:
- Constant Field Values
-
METHOD_ATTRIBUTE_PFX
the format of a method attribute name.- See Also:
- Constant Field Values
-
MODIFICATION_TIME
if it shall attempt to determine the latest modification time if this is set toLATEST.- See Also:
- Constant Field Values
-
PASS
a String representation ofpass.- See Also:
- Constant Field Values
-
PASS_FILE_PFX
the file that will not be compressed.- See Also:
- Constant Field Values
-
PROGRESS
packer progress as a percentage.- See Also:
- Constant Field Values
-
SEGMENT_LIMIT
The number of bytes of each archive segment.- See Also:
- Constant Field Values
-
STRIP
a String representation ofstrip.- See Also:
- Constant Field Values
-
TRUE
a String representation oftrue.- See Also:
- Constant Field Values
-
UNKNOWN_ATTRIBUTE
the action to take if an unknown attribute is encountered.- See Also:
- Constant Field Values
-
-
Method Details
-
properties
Returns a sorted map of the properties of this packer.- Returns:
- the properties of the packer.
-
pack
Pack the specified JAR file to the specified output stream.- Parameters:
in- JAR file to be compressed.out- stream of compressed data.- Throws:
IOException- if I/O exception occurs.
-
pack
Pack the data from the specified jar input stream to the specified output stream.- Parameters:
in- stream of uncompressed JAR data.out- stream of compressed data.- Throws:
IOException- if I/O exception occurs.
-
addPropertyChangeListener
add a listener for PropertyChange events- Parameters:
listener- the listener to listen if PropertyChange events occurs
-
removePropertyChangeListener
remove a listener- Parameters:
listener- listener to remove
-