public abstract class ArchiveInputStream
extends java.io.InputStream
InputStream.read(byte[], int, int)
- 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:
public static boolean matches(byte[] signature, int length)which is used by the
ArchiveStreamFactory
to autodetect
the archive type from the first few bytes of a stream.Constructor and Description |
---|
ArchiveInputStream() |
Modifier and Type | Method and Description |
---|---|
boolean |
canReadEntryData(ArchiveEntry archiveEntry)
Whether this stream is able to read the given entry.
|
long |
getBytesRead()
Returns the current number of bytes read from this stream.
|
int |
getCount()
Deprecated.
this method may yield wrong results for large
archives, use #getBytesRead instead
|
abstract ArchiveEntry |
getNextEntry()
Returns the next Archive Entry in this Stream.
|
int |
read()
Reads a byte of data.
|
public abstract ArchiveEntry getNextEntry() throws java.io.IOException
null
if there are no more entriesjava.io.IOException
- if the next entry could not be readpublic int read() throws java.io.IOException
InputStream.read(byte[], int, int)
method.
MUST be overridden if the InputStream.read(byte[], int, int)
method
is not overridden; may be overridden otherwise.read
in class java.io.InputStream
java.io.IOException
- if an I/O error has occurred@Deprecated public int getCount()
public long getBytesRead()
public boolean canReadEntryData(ArchiveEntry archiveEntry)
Some archive formats support variants or details that are not supported (yet).
archiveEntry
- the entry to testCopyright © 2010 - 2020 Adobe. All Rights Reserved