Top Description Fields Constructors Methods
org.apache.commons.compress.harmony.unpack200

public Class Pack200UnpackerAdapter

extends Pack200Adapter
implements Unpacker
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.java.util.jar.Pack200.Unpacker
Imports
java.io.BufferedInputStream, .File, .FileInputStream, .FilterInputStream, .IOException, .InputStream, java.net.URISyntaxException, .URL, java.nio.file.Files, .Path, .Paths, java.util.jar.JarOutputStream, org.apache.commons.compress.harmony.pack200.Pack200Adapter, .Pack200Exception, org.apache.commons.compress.java.util.jar.Pack200.Unpacker, org.apache.commons.io.input.BoundedInputStream, org.apache.commons.lang3.reflect.FieldUtils

This class provides the binding between the standard Pack200 interface and the internal interface for (un)packing.

Field Summary

Inherited from org.apache.commons.compress.harmony.pack200.Pack200Adapter:
DEFAULT_BUFFER_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static BoundedInputStream

Returns:

a new BoundedInputStream
newBoundedInputStream
(final File
The file.
file
)

Creates a new BoundedInputStream bound by the size of the given file.

private static BoundedInputStream
newBoundedInputStream(final FileInputStream fileInputStream)

pack-priv static BoundedInputStream
pack-priv static BoundedInputStream

Returns:

a new BoundedInputStream
newBoundedInputStream
(final Path
The path.
path
)

Creates a new BoundedInputStream bound by the size of the given path.

pack-priv static BoundedInputStream

Returns:

a new BoundedInputStream
newBoundedInputStream
(final String
the path string or initial part of the path string.
first
,
final String...
additional strings to be joined to form the path string.
more
)

Creates a new BoundedInputStream bound by the size of the given file.

pack-priv static BoundedInputStream

Returns:

a new BoundedInputStream
newBoundedInputStream
(final URL
The URL.
url
)

Creates a new BoundedInputStream bound by the size of the given URL to a file.

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

pack-priv static String
public void
unpack(final File
file to uncompress.
file
,
final JarOutputStream
JAR output stream of uncompressed data.
out
)

Implements org.apache.commons.compress.java.util.jar.Pack200.Unpacker.unpack.

Unpacks the contents of the specified File to the specified JAR output stream.
public void
unpack(final InputStream
stream to uncompress, preferably a BoundedInputStream.
in
,
final JarOutputStream
JAR output stream of uncompressed data.
out
)

Implements org.apache.commons.compress.java.util.jar.Pack200.Unpacker.unpack.

Unpacks the specified stream to the specified JAR output stream.
pack-priv static InputStream

Returns:

The wrapped InputStream
unwrap
(final FilterInputStream
The FilterInputStream to unwrap.
filterInputStream
)

Unwraps the given FilterInputStream to return its wrapped InputStream.

pack-priv static InputStream

Returns:

The wrapped InputStream
unwrap
(final InputStream
The FilterInputStream to unwrap.
inputStream
)

Unwraps the given InputStream if it is an FilterInputStream to return its wrapped InputStream.

Inherited from org.apache.commons.compress.harmony.pack200.Pack200Adapter:
addPropertyChangeListenercompletedfirePropertyChangepropertiesremovePropertyChangeListener

Constructor Detail

Pack200UnpackerAdapterback to summary
public Pack200UnpackerAdapter()

Method Detail

newBoundedInputStreamback to summary
pack-priv static BoundedInputStream newBoundedInputStream(final 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:File

The file.

Returns:BoundedInputStream

a new BoundedInputStream

Exceptions
IOException:
if an I/O error occurs
newBoundedInputStreamback to summary
private static BoundedInputStream newBoundedInputStream(final FileInputStream fileInputStream) throws IOException
newBoundedInputStreamback to summary
pack-priv static BoundedInputStream newBoundedInputStream(final InputStream inputStream) throws IOException
newBoundedInputStreamback to summary
pack-priv static BoundedInputStream newBoundedInputStream(final 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:Path

The path.

Returns:BoundedInputStream

a new BoundedInputStream

Annotations
@SuppressWarnings:resource
Exceptions
IOException:
if an I/O error occurs
newBoundedInputStreamback to summary
pack-priv static BoundedInputStream newBoundedInputStream(final String first, final 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:String

the path string or initial part of the path string.

more:String[]

additional strings to be joined to form the path string.

Returns:BoundedInputStream

a new BoundedInputStream

Exceptions
IOException:
if an I/O error occurs
newBoundedInputStreamback to summary
pack-priv static BoundedInputStream newBoundedInputStream(final 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:URL

The URL.

Returns:BoundedInputStream

a new BoundedInputStream

Exceptions
IOException:
if an I/O error occurs
readFieldback to summary
private static <T> T readField(final Object object, final String fieldName)
Annotations
@SuppressWarnings:unchecked
readPathback to summary
pack-priv static String readPath(final FileInputStream fis)
unpackback to summary
public void unpack(final File file, final JarOutputStream out) throws IOException

Implements org.apache.commons.compress.java.util.jar.Pack200.Unpacker.unpack.

Doc from org.apache.commons.compress.java.util.jar.Pack200.Unpacker.unpack.

Unpacks the contents of the specified File to the specified JAR output stream.

Parameters
file:File

file to uncompress.

out:JarOutputStream

JAR output stream of uncompressed data.

Annotations
@Override
Exceptions
IOException:
if I/O exception occurs.
unpackback to summary
public void unpack(final InputStream in, final JarOutputStream out) throws IOException

Implements org.apache.commons.compress.java.util.jar.Pack200.Unpacker.unpack.

Doc from org.apache.commons.compress.java.util.jar.Pack200.Unpacker.unpack.

Unpacks the specified stream to the specified JAR output stream.

Parameters
in:InputStream

stream to uncompress, preferably a BoundedInputStream.

out:JarOutputStream

JAR output stream of uncompressed data.

Annotations
@Override
Exceptions
IOException:
if I/O exception occurs.
unwrapback to summary
pack-priv static InputStream unwrap(final FilterInputStream filterInputStream)

Unwraps the given FilterInputStream to return its wrapped InputStream.

Parameters
filterInputStream:FilterInputStream

The FilterInputStream to unwrap.

Returns:InputStream

The wrapped InputStream

unwrapback to summary
pack-priv static InputStream unwrap(final InputStream inputStream)

Unwraps the given InputStream if it is an FilterInputStream to return its wrapped InputStream.

Parameters
inputStream:InputStream

The FilterInputStream to unwrap.

Returns:InputStream

The wrapped InputStream

Annotations
@SuppressWarnings:resource