Package org.apache.commons.compress.java.util.jar

# Interface Pack200.Packer

All Known Implementing Classes:
  `Pack200PackerAdapter`

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addPropertyChangeListener(PropertyChangeListener listener)`
  Adds a listener for PropertyChange events
  `void`
  `pack(JarFile in, OutputStream out)`
  Packs the specified JAR file to the specified output stream.
  `void`
  `pack(JarInputStream in, OutputStream out)`
  Packs the data from the specified jar input stream to the specified output stream.
  `SortedMap<String,String>`
  `properties()`
  Gets a sorted map of the properties of this packer.
  `void`
  `removePropertyChangeListener(PropertyChangeListener listener)`
  Removes a listener

- ## Field Details

  - ### CLASS_ATTRIBUTE_PFX

    static final String CLASS_ATTRIBUTE_PFX
    The format of a class attribute name.
    See Also:
      - Constant Field Values

  - ### CODE_ATTRIBUTE_PFX

    static final String CODE_ATTRIBUTE_PFX
    The format of a code attribute name.
    See Also:
      - Constant Field Values

  - ### DEFLATE_HINT

    static final String DEFLATE_HINT
    The deflation hint to set in the output archive.
    See Also:
      - Constant Field Values

  - ### EFFORT

    static final String EFFORT
    The indicated amount of effort to use in compressing the archive.
    See Also:
      - Constant Field Values

  - ### ERROR

    static final String ERROR
    a String representation for `error`.
    See Also:
      - Constant Field Values

  - ### FALSE

    static final String FALSE
    a String representation of `false`.
    See Also:
      - Constant Field Values

  - ### FIELD_ATTRIBUTE_PFX

    static final String FIELD_ATTRIBUTE_PFX
    The format of a field attribute name.
    See Also:
      - Constant Field Values

  - ### KEEP

    static final String KEEP
    The String representation for `keep`.
    See Also:
      - Constant Field Values

  - ### KEEP_FILE_ORDER

    static final String KEEP_FILE_ORDER
    Decide if all elements shall transmit in their original order.
    See Also:
      - Constant Field Values

  - ### LATEST

    static final String LATEST
    The String representation for `latest`.
    See Also:
      - Constant Field Values

  - ### METHOD_ATTRIBUTE_PFX

    static final String METHOD_ATTRIBUTE_PFX
    The format of a method attribute name.
    See Also:
      - Constant Field Values

  - ### MODIFICATION_TIME

    static final String MODIFICATION_TIME
    If it shall attempt to determine the latest modification time if this is set to `LATEST`.
    See Also:
      - Constant Field Values

  - ### PASS

    static final String PASS
    The String representation of `pass`.
    See Also:
      - Constant Field Values

  - ### PASS_FILE_PFX

    static final String PASS_FILE_PFX
    The file that will not be compressed.
    See Also:
      - Constant Field Values

  - ### PROGRESS

    static final String PROGRESS
    Packer progress as a percentage.
    See Also:
      - Constant Field Values

  - ### SEGMENT_LIMIT

    static final String SEGMENT_LIMIT
    The number of bytes of each archive segment.
    See Also:
      - Constant Field Values

  - ### STRIP

    static final String STRIP
    The String representation of `strip`.
    See Also:
      - Constant Field Values

  - ### TRUE

    static final String TRUE
    The String representation of `true`.
    See Also:
      - Constant Field Values

  - ### UNKNOWN_ATTRIBUTE

    static final String UNKNOWN_ATTRIBUTE
    The action to take if an unknown attribute is encountered.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### addPropertyChangeListener

    void addPropertyChangeListener(PropertyChangeListener listener)
    Adds a listener for PropertyChange events
    Parameters:
      `listener` - the listener to listen if PropertyChange events occurs

  - ### pack

    void pack(JarFile in, OutputStream out) throws IOException
    Packs 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

    void pack(JarInputStream in, OutputStream out) throws IOException
    Packs 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.

  - ### properties

    SortedMap<String,String> properties()
    Gets a sorted map of the properties of this packer.
    Returns:
      the properties of the packer.

  - ### removePropertyChangeListener

    void removePropertyChangeListener(PropertyChangeListener listener)
    Removes a listener
    Parameters:
      `listener` - listener to remove