Class Pack200UnpackerAdapter
java.lang.Object
org.apache.commons.compress.harmony.pack200.Pack200Adapter
org.apache.commons.compress.harmony.unpack200.Pack200UnpackerAdapter
- All Implemented Interfaces:
Pack200.Unpacker
This class provides the binding between the standard Pack200 interface and the internal interface for (un)packing.
-
Field Summary
Fields inherited from class org.apache.commons.compress.harmony.pack200.Pack200Adapter
DEFAULT_BUFFER_SIZEFields inherited from interface org.apache.commons.compress.java.util.jar.Pack200.Unpacker
DEFLATE_HINT, FALSE, KEEP, PROGRESS, TRUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static org.apache.commons.io.input.BoundedInputStreamnewBoundedInputStream(File file) Creates a new BoundedInputStream bound by the size of the given file.private static org.apache.commons.io.input.BoundedInputStreamnewBoundedInputStream(FileInputStream fileInputStream) (package private) static org.apache.commons.io.input.BoundedInputStreamnewBoundedInputStream(InputStream inputStream) (package private) static org.apache.commons.io.input.BoundedInputStreamnewBoundedInputStream(String first, String... more) Creates a new BoundedInputStream bound by the size of the given file.(package private) static org.apache.commons.io.input.BoundedInputStreamnewBoundedInputStream(URL url) Creates a new BoundedInputStream bound by the size of the given URL to a file.(package private) static org.apache.commons.io.input.BoundedInputStreamnewBoundedInputStream(Path path) Creates a new BoundedInputStream bound by the size of the given path.private static <T> T(package private) static Stringvoidunpack(File file, JarOutputStream out) Unpacks the contents of the specifiedFileto the specified JAR output stream.voidunpack(InputStream in, JarOutputStream out) Unpacks the specified stream to the specified JAR output stream.(package private) static InputStreamunwrap(FilterInputStream filterInputStream) Unwraps the given FilterInputStream to return its wrapped InputStream.(package private) static InputStreamunwrap(InputStream inputStream) Unwraps the given InputStream if it is an FilterInputStream to return its wrapped InputStream.Methods inherited from class org.apache.commons.compress.harmony.pack200.Pack200Adapter
addPropertyChangeListener, completed, firePropertyChange, properties, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.compress.java.util.jar.Pack200.Unpacker
addPropertyChangeListener, properties, removePropertyChangeListener
-
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
-
readPathString
-
unwrap
Unwraps the given FilterInputStream to return its wrapped InputStream.- Parameters:
filterInputStream- The FilterInputStream to unwrap.- Returns:
- The wrapped InputStream
-
unwrap
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
Description copied from interface:Pack200.UnpackerUnpacks the contents of the specifiedFileto the specified JAR output stream.- Specified by:
unpackin interfacePack200.Unpacker- Parameters:
file- file to uncompress.out- JAR output stream of uncompressed data.- Throws:
IOException- if I/O exception occurs.
-
unpack
Description copied from interface:Pack200.UnpackerUnpacks the specified stream to the specified JAR output stream.- Specified by:
unpackin interfacePack200.Unpacker- Parameters:
in- stream to uncompress, preferably aBoundedInputStream.out- JAR output stream of uncompressed data.- Throws:
IOException- if I/O exception occurs.
-