org.codehaus.plexus.archiver.zip
Class ZipFile.BoundedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.codehaus.plexus.archiver.zip.ZipFile.BoundedInputStream
All Implemented Interfaces:
java.io.Closeable
Enclosing class:
ZipFile

private class ZipFile.BoundedInputStream
extends java.io.InputStream

InputStream that delegates requests to the underlying RandomAccessFile, making sure that only bytes from a certain range can be read.


Field Summary
private  boolean addDummyByte
           
private  long loc
           
private  long remaining
           
 
Constructor Summary
ZipFile.BoundedInputStream(long start, long remaining)
           
 
Method Summary
(package private)  void addDummy()
          Inflater needs an extra dummy byte for nowrap - see Inflater's javadocs.
 int read()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, close, 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

loc

private long loc

addDummyByte

private boolean addDummyByte
Constructor Detail

ZipFile.BoundedInputStream

ZipFile.BoundedInputStream(long start,
                           long remaining)
Method Detail

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

addDummy

void addDummy()
Inflater needs an extra dummy byte for nowrap - see Inflater's javadocs.