Android APIs
Added in 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
String CLASS_ATTRIBUTE_PFX the format of a class attribute name.
String CODE_ATTRIBUTE_PFX the format of a code attribute name.
String DEFLATE_HINT the deflation hint to set in the output archive.
String EFFORT the indicated amount of effort to use in compressing the archive.
String ERROR a String representation for error.
String FALSE a String representation of false.
String FIELD_ATTRIBUTE_PFX the format of a field attribute name.
String KEEP a String representation for keep.
String KEEP_FILE_ORDER decide if all elements shall transmit in their original order.
String LATEST a String representation for latest.
String METHOD_ATTRIBUTE_PFX the format of a method attribute name.
String MODIFICATION_TIME if it shall attempt to determine the latest modification time if this is set to LATEST.
String PASS a String representation of pass.
String PASS_FILE_PFX the file that will not be compressed.
String PROGRESS packer progress as a percentage.
String SEGMENT_LIMIT The number of bytes of each archive segment.
String STRIP a String representation of strip.
String TRUE a String representation of true.
String UNKNOWN_ATTRIBUTE the 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

Added in API level 1

the format of a class attribute name.

Constant Value: "pack.class.attribute."

public static final String CODE_ATTRIBUTE_PFX

Added in API level 1

the format of a code attribute name.

Constant Value: "pack.code.attribute."

public static final String DEFLATE_HINT

Added in API level 1

the deflation hint to set in the output archive.

Constant Value: "pack.deflate.hint"

public static final String EFFORT

Added in API level 1

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

Constant Value: "pack.effort"

public static final String ERROR

Added in API level 1

a String representation for error.

Constant Value: "error"

public static final String FALSE

Added in API level 1

a String representation of false.

Constant Value: "false"

public static final String FIELD_ATTRIBUTE_PFX

Added in API level 1

the format of a field attribute name.

Constant Value: "pack.field.attribute."

public static final String KEEP

Added in API level 1

a String representation for keep.

Constant Value: "keep"

public static final String KEEP_FILE_ORDER

Added in API level 1

decide if all elements shall transmit in their original order.

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

public static final String LATEST

Added in API level 1

a String representation for latest.

Constant Value: "latest"

public static final String METHOD_ATTRIBUTE_PFX

Added in API level 1

the format of a method attribute name.

Constant Value: "pack.method.attribute."

public static final String MODIFICATION_TIME

Added in 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

Added in API level 1

a String representation of pass.

Constant Value: "pass"

public static final String PASS_FILE_PFX

Added in API level 1

the file that will not be compressed.

Constant Value: "pack.pass.file."

public static final String PROGRESS

Added in API level 1

packer progress as a percentage.

Constant Value: "pack.progress"

public static final String SEGMENT_LIMIT

Added in API level 1

The number of bytes of each archive segment.

Constant Value: "pack.segment.limit"

public static final String STRIP

Added in API level 1

a String representation of strip.

Constant Value: "strip"

public static final String TRUE

Added in API level 1

a String representation of true.

Constant Value: "true"

public static final String UNKNOWN_ATTRIBUTE

Added in 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)

Added in API level 3

add a listener for PropertyChange events

Parameters
listener PropertyChangeListener: the listener to listen if PropertyChange events occurs

public abstract void pack (JarFile in, OutputStream out)

Added in API level 1

Pack the specified JAR file to the specified output stream.

Parameters
in JarFile: JAR file to be compressed.
out OutputStream: stream of compressed data.
Throws
IOException if I/O exception occurs.

public abstract void pack (JarInputStream in, OutputStream out)

Added in API level 1

Pack the data from the specified jar input stream to the specified output stream.

Parameters
in JarInputStream: stream of uncompressed JAR data.
out OutputStream: stream of compressed data.
Throws
IOException if I/O exception occurs.

public abstract SortedMap<StringString> properties ()

Added in API level 1

Returns a sorted map of the properties of this packer.

Returns
SortedMap<StringString> the properties of the packer.

public abstract void removePropertyChangeListener (PropertyChangeListener listener)

Added in API level 3

remove a listener

Parameters
listener PropertyChangeListener: listener to remove