Since: API Level 1
public static interface

Pack200.Packer

java.util.jar.Pack200.Packer

Class Overview

The interface defining the API for converting a JAR file to an output stream in the Pack200 format.

Summary

Constants
StringCLASS_ATTRIBUTE_PFXthe format of a class attribute name.
StringCODE_ATTRIBUTE_PFXthe format of a code attribute name.
StringDEFLATE_HINTthe deflation hint to set in the output archive.
StringEFFORTthe indicated amount of effort to use in compressing the archive.
StringERRORa String representation for error.
StringFALSEa String representation of false.
StringFIELD_ATTRIBUTE_PFXthe format of a field attribute name.
StringKEEPa String representation for keep.
StringKEEP_FILE_ORDERdecide if all elements shall transmit in their original order.
StringLATESTa String representation for latest.
StringMETHOD_ATTRIBUTE_PFXthe format of a method attribute name.
StringMODIFICATION_TIMEif it shall attempt to determine the latest modification time if this is set to LATEST.
StringPASSa String representation of pass.
StringPASS_FILE_PFXthe file that will not be compressed.
StringPROGRESSpacker progress as a percentage.
StringSEGMENT_LIMITThe number of bytes of each archive segment.
StringSTRIPa String representation of strip.
StringTRUEa String representation of true.
StringUNKNOWN_ATTRIBUTEthe action to take if an unknown attribute is encountered.
Public Methods
abstract void addPropertyChangeListener(PropertyChangeListener listener)
add a listener for PropertyChange events
abstract void pack(JarFile in, OutputStream out)
Pack the specified JAR file to the specified output stream.
abstract void pack(JarInputStream in, OutputStream out)
Pack the data from the specified jar input stream to the specified output stream.
abstract SortedMap<StringString> properties()
Returns a sorted map of the properties of this packer.
abstract void removePropertyChangeListener(PropertyChangeListener listener)
remove a listener

Constants

public static final String CLASS_ATTRIBUTE_PFX

Since: API Level 1

the format of a class attribute name.

Constant Value: "pack.class.attribute."

public static final String CODE_ATTRIBUTE_PFX

Since: API Level 1

the format of a code attribute name.

Constant Value: "pack.code.attribute."

public static final String DEFLATE_HINT

Since: API Level 1

the deflation hint to set in the output archive.

Constant Value: "pack.deflate.hint"

public static final String EFFORT

Since: API Level 1

the indicated amount of effort to use in compressing the archive.

Constant Value: "pack.effort"

public static final String ERROR

Since: API Level 1

a String representation for error.

Constant Value: "error"

public static final String FALSE

Since: API Level 1

a String representation of false.

Constant Value: "false"

public static final String FIELD_ATTRIBUTE_PFX

Since: API Level 1

the format of a field attribute name.

Constant Value: "pack.field.attribute."

public static final String KEEP

Since: API Level 1

a String representation for keep.

Constant Value: "keep"

public static final String KEEP_FILE_ORDER

Since: API Level 1

decide if all elements shall transmit in their original order.

Constant Value: "pack.keep.file.order"

public static final String LATEST

Since: API Level 1

a String representation for latest.

Constant Value: "latest"

public static final String METHOD_ATTRIBUTE_PFX

Since: API Level 1

the format of a method attribute name.

Constant Value: "pack.method.attribute."

public static final String MODIFICATION_TIME

Since: API Level 1

if it shall attempt to determine the latest modification time if this is set to LATEST.

Constant Value: "pack.modification.time"

public static final String PASS

Since: API Level 1

a String representation of pass.

Constant Value: "pass"

public static final String PASS_FILE_PFX

Since: API Level 1

the file that will not be compressed.

Constant Value: "pack.pass.file."

public static final String PROGRESS

Since: API Level 1

packer progress as a percentage.

Constant Value: "pack.progress"

public static final String SEGMENT_LIMIT

Since: API Level 1

The number of bytes of each archive segment.

Constant Value: "pack.segment.limit"

public static final String STRIP

Since: API Level 1

a String representation of strip.

Constant Value: "strip"

public static final String TRUE

Since: API Level 1

a String representation of true.

Constant Value: "true"

public static final String UNKNOWN_ATTRIBUTE

Since: API Level 1

the action to take if an unknown attribute is encountered.

Constant Value: "pack.unknown.attribute"

Public Methods

public abstract void addPropertyChangeListener (PropertyChangeListener listener)

Since: API Level 3

add a listener for PropertyChange events

Parameters
listener the listener to listen if PropertyChange events occurs

public abstract void pack (JarFile in, OutputStream out)

Since: API Level 1

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.

public abstract void pack (JarInputStream in, OutputStream out)

Since: API Level 1

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.

public abstract SortedMap<StringString> properties ()

Since: API Level 1

Returns a sorted map of the properties of this packer.

Returns
  • the properties of the packer.

public abstract void removePropertyChangeListener (PropertyChangeListener listener)

Since: API Level 3

remove a listener

Parameters
listener listener to remove