Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.jar

public Class JarArchiveInputStream

extends ZipArchiveInputStream
Class Inheritance
Imports
java.io.IOException, .InputStream, org.apache.commons.compress.archivers.zip.ZipArchiveEntry, .ZipArchiveInputStream

Implements an input stream that can read entries from jar files.

Field Summary

Inherited from org.apache.commons.compress.archivers.zip.ZipArchiveInputStream:
PREAMBLE_GARBAGE_MAX_SIZE

Constructor Summary

AccessConstructor and Description
public
JarArchiveInputStream(final InputStream
the input stream to wrap
inputStream
)

Creates an instance from the input stream using the default encoding.

public
JarArchiveInputStream(final InputStream
the input stream to wrap
inputStream
,
final String
the encoding to use
encoding
)

Creates an instance from the input stream using the specified encoding.

Method Summary

Modifier and TypeMethod and Description
public JarArchiveEntry
public JarArchiveEntry

Returns:

the next entry.
getNextJarEntry
()

Deprecated Use getNextEntry().
Gets the next entry.
public static boolean

Returns:

true, if this stream is a jar archive stream, false otherwise
matches
(final byte[]
the bytes to check
signature
,
final int
the number of bytes to check
length
)

Hides org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.matches.

Checks if the signature matches what is expected for a jar file (in this case it is the same as for a ZIP file).
Inherited from org.apache.commons.compress.archivers.zip.ZipArchiveInputStream:
canReadEntryDataclosegetCompressedCountgetNextZipEntrygetUncompressedCountreadsetExtraFieldSupportskip

Constructor Detail

JarArchiveInputStreamback to summary
public JarArchiveInputStream(final InputStream inputStream)

Creates an instance from the input stream using the default encoding.

Parameters
inputStream:InputStream

the input stream to wrap

JarArchiveInputStreamback to summary
public JarArchiveInputStream(final InputStream inputStream, final String encoding)

Creates an instance from the input stream using the specified encoding.

Parameters
inputStream:InputStream

the input stream to wrap

encoding:String

the encoding to use

Since
1.10

Method Detail

getNextEntryback to summary
public JarArchiveEntry getNextEntry() throws IOException

Overrides org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextEntry.

Doc from org.apache.commons.compress.archivers.ArchiveInputStream.getNextEntry.

Gets the next Archive Entry in this Stream.

Returns:JarArchiveEntry

the next entry, or null if there are no more entries

Annotations
@Override
Exceptions
IOException:
if the next entry could not be read
getNextJarEntryback to summary
public JarArchiveEntry getNextJarEntry() throws IOException

Deprecated

Use getNextEntry().

Gets the next entry.

Returns:JarArchiveEntry

the next entry.

Annotations
@Deprecated
Exceptions
IOException:
if an I/O error occurs.
matchesback to summary
public static boolean matches(final byte[] signature, final int length)

Hides org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.matches.

Checks if the signature matches what is expected for a jar file (in this case it is the same as for a ZIP file).

Parameters
signature:byte[]

the bytes to check

length:int

the number of bytes to check

Returns:boolean

true, if this stream is a jar archive stream, false otherwise