-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public abstract class ArchiveInputStream extends InputStream
Archive input streams MUST override the read - or read - method so that reading from the stream generates EOF for the end of data in each entry as well as at the end of the file proper.
The getNextEntry method is used to reset the input stream ready for reading the data from the next entry.
The input stream classes must also implement a method with the signature:
which is used by the ArchiveStreamFactory to autodetect the archive type from the first few bytes of a stream.public static boolean matches(byte[] signature, int length)
-
-
Field Summary
Fields Modifier and Type Field Description private longbytesRead
-
Method Summary
Modifier and Type Method Description longgetBytesRead()Returns the current number of bytes read from this stream. booleancanReadEntryData(ArchiveEntry archiveEntry)Whether this stream is able to read the given entry. intgetCount()Returns the current number of bytes read from this stream. abstract ArchiveEntrygetNextEntry()Returns the next Archive Entry in this Stream. intread()Reads a byte of data. -
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getBytesRead
long getBytesRead()
Returns the current number of bytes read from this stream.
-
canReadEntryData
boolean canReadEntryData(ArchiveEntry archiveEntry)
Whether this stream is able to read the given entry.
Some archive formats support variants or details that are not supported (yet).
- Parameters:
archiveEntry- the entry to test
-
getCount
@Deprecated() int getCount()
Returns the current number of bytes read from this stream.
-
getNextEntry
abstract ArchiveEntry getNextEntry()
Returns the next Archive Entry in this Stream.
-
read
int read()
-
-
-
-