|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream org.apache.commons.compress.archivers.ArchiveInputStream
public abstract class ArchiveInputStream
Archive input streams MUST override the
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 Summary | |
---|---|
ArchiveInputStream()
|
Method Summary | |
---|---|
protected void |
count(int read)
Increments the counter of already read bytes. |
int |
getCount()
Returns the current number of bytes read from this stream. |
abstract ArchiveEntry |
getNextEntry()
Returns the next Archive Entry in this Stream. |
int |
read()
Reads a byte of data. |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArchiveInputStream()
Method Detail |
---|
public abstract ArchiveEntry getNextEntry() throws IOException
null
if there are no more entries
IOException
- if the next entry could not be readpublic int read() throws 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 InputStream
IOException
- if an I/O error has occurred or if a CPIO file error has
occurredprotected void count(int read)
read
- the number of bytes readpublic int getCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |