E - The type of ArchiveEntry produced.public abstract class ArchiveInputStream<E extends ArchiveEntry>
extends java.io.FilterInputStream
FilterInputStream.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()
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canReadEntryData(ArchiveEntry archiveEntry)
Whether this stream is able to read the given entry.
|
long |
getBytesRead()
Gets the current number of bytes read from this stream.
|
java.nio.charset.Charset |
getCharset()
Gets the Charest.
|
int |
getCount()
Deprecated.
this method may yield wrong results for large archives, use
getBytesRead() instead. |
abstract E |
getNextEntry()
Gets the next Archive Entry in this Stream.
|
void |
mark(int readlimit)
Does nothing.
|
boolean |
markSupported()
Always returns false.
|
int |
read()
Reads a byte of data.
|
void |
reset()
Does nothing.
|
public boolean canReadEntryData(ArchiveEntry archiveEntry)
Some archive formats support variants or details that are not supported (yet).
archiveEntry - the entry to testpublic long getBytesRead()
public java.nio.charset.Charset getCharset()
@Deprecated public int getCount()
getBytesRead() instead.public abstract E getNextEntry() throws java.io.IOException
null if there are no more entriesjava.io.IOException - if the next entry could not be readpublic void mark(int readlimit)
mark in class java.io.FilterInputStreamreadlimit - ignored.public boolean markSupported()
markSupported in class java.io.FilterInputStreampublic int read()
throws java.io.IOException
FilterInputStream.read(byte[], int, int) method.
MUST be overridden if the FilterInputStream.read(byte[], int, int) method is not overridden; may be overridden otherwise.read in class java.io.FilterInputStreamjava.io.IOException - if an I/O error has occurredpublic void reset()
throws java.io.IOException
reset in class java.io.FilterInputStreamjava.io.IOException - not thrown here but may be thrown from a subclass.Copyright © 2010 - 2024 Adobe. All Rights Reserved