Package kala.compress.harmony.unpack200
Class Pack200UnpackerAdapter
java.lang.Object
kala.compress.harmony.pack200.Pack200Adapter
kala.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 kala.compress.harmony.pack200.Pack200Adapter
DEFAULT_BUFFER_SIZEFields inherited from interface kala.compress.java.util.jar.Pack200.Unpacker
DEFLATE_HINT, FALSE, KEEP, PROGRESS, TRUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static BoundedInputStreamnewBoundedInputStream(File file) Creates a new BoundedInputStream bound by the size of the given file.private static BoundedInputStreamnewBoundedInputStream(FileInputStream fileInputStream) (package private) static BoundedInputStreamnewBoundedInputStream(InputStream inputStream) (package private) static BoundedInputStreamnewBoundedInputStream(String first, String... more) Creates a new BoundedInputStream bound by the size of the given file.(package private) static BoundedInputStreamnewBoundedInputStream(URL url) Creates a new BoundedInputStream bound by the size of the given URL to a file.(package private) static 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 kala.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 kala.compress.java.util.jar.Pack200.Unpacker
addPropertyChangeListener, properties, removePropertyChangeListener
-
Constructor Details
-
Pack200UnpackerAdapter
public Pack200UnpackerAdapter()
-
-
Method Details
-
newBoundedInputStream
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 BoundedInputStream newBoundedInputStream(FileInputStream fileInputStream) throws IOException - Throws:
IOException
-
newBoundedInputStream
- Throws:
IOException
-
newBoundedInputStream
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
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
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 occursURISyntaxException
-
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.
-