java.lang.Object
java.io.InputStream
java.io.FilterInputStream
kala.compress.archivers.ArchiveInputStream<ZipArchiveEntry>
kala.compress.archivers.zip.ZipArchiveInputStream
kala.compress.archivers.jar.JarArchiveInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,InputStreamStatistics
Implements an input stream that can read entries from jar files.
-
Field Summary
Fields inherited from class kala.compress.archivers.zip.ZipArchiveInputStream
PREAMBLE_GARBAGE_MAX_SIZEFields inherited from class kala.compress.archivers.ArchiveInputStream
encodingFields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionJarArchiveInputStream(InputStream inputStream) Creates an instance from the input stream using the default encoding.JarArchiveInputStream(InputStream inputStream, Charset encoding) Creates an instance from the input stream using the specified encoding. -
Method Summary
Modifier and TypeMethodDescriptionGets the next Archive Entry in this Stream.static booleanmatches(byte[] signature, int length) Checks if the signature matches what is expected for a jar file (in this case it is the same as for a ZIP file).Methods inherited from class kala.compress.archivers.zip.ZipArchiveInputStream
canReadEntryData, close, getCompressedCount, getUncompressedCount, read, skipMethods inherited from class kala.compress.archivers.ArchiveInputStream
count, count, forEach, getBytesRead, getEncoding, iterator, mark, markSupported, pushedBackBytes, read, resetMethods inherited from class java.io.FilterInputStream
available, readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
JarArchiveInputStream
Creates an instance from the input stream using the default encoding.- Parameters:
inputStream- the input stream to wrap
-
JarArchiveInputStream
Creates an instance from the input stream using the specified encoding.- Parameters:
inputStream- the input stream to wrapencoding- the encoding to use- Since:
- 1.27.1-0
-
-
Method Details
-
matches
public static boolean matches(byte[] signature, int length) 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- the bytes to checklength- the number of bytes to check- Returns:
- true, if this stream is a jar archive stream, false otherwise
-
getNextEntry
Description copied from class:ArchiveInputStreamGets the next Archive Entry in this Stream.- Overrides:
getNextEntryin classZipArchiveInputStream- Returns:
- the next entry, or
nullif there are no more entries. - Throws:
IOException- if the next entry could not be read.
-