TrueZIP 6.8.2

de.schlichtherle.util.zip
Class BasicZipFile.IntervalInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by de.schlichtherle.util.zip.BasicZipFile.AccountedInputStream
          extended by 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!


Field Summary
private  boolean addDummyByte
           
private  long fp
           
private  long remaining
           
 
Constructor Summary
BasicZipFile.IntervalInputStream(long start, long remaining)
           
 
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 de.schlichtherle.util.zip.BasicZipFile.AccountedInputStream
close
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remaining

private long remaining

fp

private long fp

addDummyByte

private boolean addDummyByte
Constructor Detail

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.
Method Detail

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

TrueZIP 6.8.2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.