de.schlichtherle.util.zip
Class BasicZipFile.IntervalInputStream
java.lang.Object
java.io.InputStream
de.schlichtherle.util.zip.BasicZipFile.AccountedInputStream
de.schlichtherle.util.zip.BasicZipFile.IntervalInputStream
- All Implemented Interfaces:
- Closeable
- Enclosing class:
- BasicZipFile
private class BasicZipFile.IntervalInputStream
- extends BasicZipFile.AccountedInputStream
InputStream that delegates requests to the underlying
RandomAccessFile, making sure that only bytes from a certain
range can be read.
Calling close() on the enclosing BasicZipFile instance causes all
corresponding instances of this member class to get close()d, too.
Note that this class is not thread safe!
|
Method Summary |
(package private) void |
addDummy()
Inflater needs an extra dummy byte for nowrap - see
Inflater's javadocs. |
int |
available()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
remaining
private long remaining
fp
private long fp
addDummyByte
private boolean addDummyByte
BasicZipFile.IntervalInputStream
BasicZipFile.IntervalInputStream(long start,
long remaining)
- Parameters:
start - The start address (not offset) in archive.remaining - The remaining bytes allowed to be read in
archive.
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException
addDummy
void addDummy()
- Inflater needs an extra dummy byte for nowrap - see
Inflater's javadocs.
available
public int available()
throws IOException
- Overrides:
available in class InputStream
- Returns:
- The number of bytes remaining in this entry, yet maximum
Integer.MAX_VALUE.
Note that this is only relevant for entries which have been
stored with the STORED method.
For entries stored according to the DEFLATED
method, the value returned by this method on the
InputStream returned by BasicZipFile.getInputStream(java.lang.String)
is actually determined by an InflaterInputStream.
- Throws:
IOException
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.