Class Pack200UnpackerAdapter

java.lang.Object
org.apache.commons.compress.harmony.pack200.Pack200Adapter
org.apache.commons.compress.harmony.unpack200.Pack200UnpackerAdapter
All Implemented Interfaces:
Pack200.Unpacker

public class Pack200UnpackerAdapter extends Pack200Adapter implements Pack200.Unpacker
This class provides the binding between the standard Pack200 interface and the internal interface for (un)packing.
  • Constructor Details

    • Pack200UnpackerAdapter

      public Pack200UnpackerAdapter()
  • Method Details

    • newBoundedInputStream

      static org.apache.commons.io.input.BoundedInputStream newBoundedInputStream(File file) throws IOException
      Creates a new BoundedInputStream bound by the size of the given file.

      The new BoundedInputStream wraps a new BufferedInputStream.

      Parameters:
      file - The file.
      Returns:
      a new BoundedInputStream
      Throws:
      IOException - if an I/O error occurs
    • newBoundedInputStream

      private static org.apache.commons.io.input.BoundedInputStream newBoundedInputStream(FileInputStream fileInputStream) throws IOException
      Throws:
      IOException
    • newBoundedInputStream

      static org.apache.commons.io.input.BoundedInputStream newBoundedInputStream(InputStream inputStream) throws IOException
      Throws:
      IOException
    • newBoundedInputStream

      static org.apache.commons.io.input.BoundedInputStream newBoundedInputStream(Path path) throws IOException
      Creates a new BoundedInputStream bound by the size of the given path.

      The new BoundedInputStream wraps a new BufferedInputStream.

      Parameters:
      path - The path.
      Returns:
      a new BoundedInputStream
      Throws:
      IOException - if an I/O error occurs
    • newBoundedInputStream

      static org.apache.commons.io.input.BoundedInputStream newBoundedInputStream(String first, String... more) throws IOException
      Creates a new BoundedInputStream bound by the size of the given file.

      The new BoundedInputStream wraps a new BufferedInputStream.

      Parameters:
      first - the path string or initial part of the path string.
      more - additional strings to be joined to form the path string.
      Returns:
      a new BoundedInputStream
      Throws:
      IOException - if an I/O error occurs
    • newBoundedInputStream

      static org.apache.commons.io.input.BoundedInputStream newBoundedInputStream(URL url) throws IOException, URISyntaxException
      Creates a new BoundedInputStream bound by the size of the given URL to a file.

      The new BoundedInputStream wraps a new BufferedInputStream.

      Parameters:
      url - The URL.
      Returns:
      a new BoundedInputStream
      Throws:
      IOException - if an I/O error occurs.
      URISyntaxException - if the URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.
    • readField

      private static <T> T readField(Object object, String fieldName)
    • readPathString

      static String readPathString(FileInputStream fis)
    • unwrap

      static InputStream unwrap(FilterInputStream filterInputStream)
      Unwraps the given FilterInputStream to return its wrapped InputStream.
      Parameters:
      filterInputStream - The FilterInputStream to unwrap.
      Returns:
      The wrapped InputStream
    • unwrap

      static InputStream unwrap(InputStream inputStream)
      Unwraps the given InputStream if it is an FilterInputStream to return its wrapped InputStream.
      Parameters:
      inputStream - The FilterInputStream to unwrap.
      Returns:
      The wrapped InputStream
    • unpack

      public void unpack(File file, JarOutputStream out) throws IOException
      Description copied from interface: Pack200.Unpacker
      Unpacks the contents of the specified File to the specified JAR output stream.
      Specified by:
      unpack in interface Pack200.Unpacker
      Parameters:
      file - file to uncompress.
      out - JAR output stream of uncompressed data.
      Throws:
      IOException - if I/O exception occurs.
    • unpack

      public void unpack(InputStream in, JarOutputStream out) throws IOException
      Description copied from interface: Pack200.Unpacker
      Unpacks the specified stream to the specified JAR output stream.
      Specified by:
      unpack in interface Pack200.Unpacker
      Parameters:
      in - stream to uncompress, preferably a BoundedInputStream.
      out - JAR output stream of uncompressed data.
      Throws:
      IOException - if I/O exception occurs.