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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Adds a listener for PropertyChange events
      void pack​(java.util.jar.JarFile in, java.io.OutputStream out)
      Packs the specified JAR file to the specified output stream.
      void pack​(java.util.jar.JarInputStream in, java.io.OutputStream out)
      Packs the data from the specified jar input stream to the specified output stream.
      java.util.SortedMap<java.lang.String,​java.lang.String> properties()
      Gets a sorted map of the properties of this packer.
      void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Removes a listener
    • Method Detail

      • addPropertyChangeListener

        void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Adds a listener for PropertyChange events
        Parameters:
        listener - the listener to listen if PropertyChange events occurs
      • pack

        void pack​(java.util.jar.JarFile in,
                  java.io.OutputStream out)
           throws java.io.IOException
        Packs the specified JAR file to the specified output stream.
        Parameters:
        in - JAR file to be compressed.
        out - target output stream for the compressed data.
        Throws:
        java.io.IOException - if I/O exception occurs.
      • pack

        void pack​(java.util.jar.JarInputStream in,
                  java.io.OutputStream out)
           throws java.io.IOException
        Packs the data from the specified jar input stream to the specified output stream.
        Parameters:
        in - input stream of uncompressed JAR data.
        out - target output stream for the compressed data.
        Throws:
        java.io.IOException - if I/O exception occurs.
      • properties

        java.util.SortedMap<java.lang.String,​java.lang.String> properties()
        Gets a sorted map of the properties of this packer.
        Returns:
        the properties of the packer.
      • removePropertyChangeListener

        void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Removes a listener
        Parameters:
        listener - listener to remove