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
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.
-
-
Field Summary
-
Fields inherited from class kala.compress.harmony.pack200.Pack200Adapter
DEFAULT_BUFFER_SIZE
-
Fields inherited from interface kala.compress.java.util.jar.Pack200.Unpacker
DEFLATE_HINT, FALSE, KEEP, PROGRESS, TRUE
-
-
Constructor Summary
Constructors Constructor Description Pack200UnpackerAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static BoundedInputStreamnewBoundedInputStream(java.io.File file)Creates a new BoundedInputStream bound by the size of the given file.private static BoundedInputStreamnewBoundedInputStream(java.io.FileInputStream fileInputStream)(package private) static BoundedInputStreamnewBoundedInputStream(java.io.InputStream inputStream)(package private) static BoundedInputStreamnewBoundedInputStream(java.lang.String first, java.lang.String... more)Creates a new BoundedInputStream bound by the size of the given file.(package private) static BoundedInputStreamnewBoundedInputStream(java.net.URL url)Creates a new BoundedInputStream bound by the size of the given URL to a file.(package private) static BoundedInputStreamnewBoundedInputStream(java.nio.file.Path path)Creates a new BoundedInputStream bound by the size of the given path.private static <T> TreadField(java.lang.Object target, java.lang.Class<?> cls, java.lang.String fieldName)(package private) static java.lang.StringreadPathString(java.io.FileInputStream fis)voidunpack(java.io.File file, java.util.jar.JarOutputStream out)Unpacks the contents of the specifiedFileto the specified JAR output stream.voidunpack(java.io.InputStream in, java.util.jar.JarOutputStream out)Unpacks the specified stream to the specified JAR output stream.(package private) static java.io.InputStreamunwrap(java.io.FilterInputStream filterInputStream)Unwraps the given FilterInputStream to return its wrapped InputStream.(package private) static java.io.InputStreamunwrap(java.io.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, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface kala.compress.java.util.jar.Pack200.Unpacker
addPropertyChangeListener, properties, removePropertyChangeListener
-
-
-
-
Method Detail
-
newBoundedInputStream
static BoundedInputStream newBoundedInputStream(java.io.File file) throws java.io.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:
java.io.IOException- if an I/O error occurs
-
newBoundedInputStream
private static BoundedInputStream newBoundedInputStream(java.io.FileInputStream fileInputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
newBoundedInputStream
static BoundedInputStream newBoundedInputStream(java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
newBoundedInputStream
static BoundedInputStream newBoundedInputStream(java.nio.file.Path path) throws java.io.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:
java.io.IOException- if an I/O error occurs
-
newBoundedInputStream
static BoundedInputStream newBoundedInputStream(java.lang.String first, java.lang.String... more) throws java.io.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:
java.io.IOException- if an I/O error occurs
-
newBoundedInputStream
static BoundedInputStream newBoundedInputStream(java.net.URL url) throws java.io.IOException, java.net.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:
java.io.IOException- if an I/O error occursjava.net.URISyntaxException
-
readField
private static <T> T readField(java.lang.Object target, java.lang.Class<?> cls, java.lang.String fieldName)
-
readPathString
static java.lang.String readPathString(java.io.FileInputStream fis)
-
unwrap
static java.io.InputStream unwrap(java.io.FilterInputStream filterInputStream)
Unwraps the given FilterInputStream to return its wrapped InputStream.- Parameters:
filterInputStream- The FilterInputStream to unwrap.- Returns:
- The wrapped InputStream
-
unwrap
static java.io.InputStream unwrap(java.io.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(java.io.File file, java.util.jar.JarOutputStream out) throws java.io.IOExceptionDescription 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:
java.io.IOException- if I/O exception occurs.
-
unpack
public void unpack(java.io.InputStream in, java.util.jar.JarOutputStream out) throws java.io.IOExceptionDescription 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:
java.io.IOException- if I/O exception occurs.
-
-