ArchiveEntry produced.
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.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private long | bytesRead
The number of bytes read in this stream |
| private Charset | |
| private final byte[] |
| Access | Constructor and Description |
|---|---|
| public | |
| private | ArchiveInputStream(final InputStream
the underlying input stream, or inputStream, final Charset null if this instance is to be created without an underlying stream.charset. charset)Constructs a new instance. |
| protected | ArchiveInputStream(final InputStream
the underlying input stream, or inputStream, final String null if this instance is to be created without an underlying stream.charset name. charsetName)Constructs a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: This implementation always returns true.the entry to test archiveEntry)Whether this stream is able to read the given entry. |
| protected void | |
| protected void | |
| public long | Returns: the number of read bytesGets the current number of bytes read from this stream. |
| public Charset | |
| public int | Returns: the number of read bytes
Deprecated
this method may yield wrong results for large archives, use
Gets the current number of bytes read from this stream.
getBytesRead() instead.
|
| public abstract E | Returns: the next entry, ornull if there are no more entriesGets the next Archive Entry in this Stream. |
| protected void | pushedBackBytes(final long
the number of bytes pushed back. pushedBack)Decrements the counter of already read bytes. |
| public int | Returns: the byte read, or -1 if end of input is reachedOverrides java. |
| BYTE_MASK | back to summary |
|---|---|
| private static final int BYTE_MASK | |
| bytesRead | back to summary |
|---|---|
| private long bytesRead The number of bytes read in this stream | |
| charset | back to summary |
|---|---|
| private Charset charset | |
| single | back to summary |
|---|---|
| private final byte[] single | |
| ArchiveInputStream | back to summary |
|---|---|
| public ArchiveInputStream() Constructs a new instance. | |
| ArchiveInputStream | back to summary |
|---|---|
| private ArchiveInputStream(final InputStream inputStream, final Charset charset) Constructs a new instance.
| |
| ArchiveInputStream | back to summary |
|---|---|
| protected ArchiveInputStream(final InputStream inputStream, final String charsetName) Constructs a new instance.
| |
| canReadEntryData | back to summary |
|---|---|
| public boolean canReadEntryData(final ArchiveEntry archiveEntry) Whether this stream is able to read the given entry. Some archive formats support variants or details that are not supported (yet).
| |
| count | back to summary |
|---|---|
| protected void count(final int read) Increments the counter of already read bytes. Doesn't increment if the EOF has been hit (read == -1)
| |
| count | back to summary |
|---|---|
| protected void count(final long read) Increments the counter of already read bytes. Doesn't increment if the EOF has been hit (read == -1)
| |
| getBytesRead | back to summary |
|---|---|
| public long getBytesRead() Gets the current number of bytes read from this stream.
| |
| getCharset | back to summary |
|---|---|
| public Charset getCharset() Gets the Charest.
| |
| getCount | back to summary |
|---|---|
| public int getCount()
Deprecated this method may yield wrong results for large archives, use Gets the current number of bytes read from this stream.
| |
| getNextEntry | back to summary |
|---|---|
| public abstract E getNextEntry() throws IOException Gets the next Archive Entry in this Stream.
| |
| pushedBackBytes | back to summary |
|---|---|
| protected void pushedBackBytes(final long pushedBack) Decrements the counter of already read bytes.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Reads a byte of data. This method will block until enough input is available.
Simply calls the
| |