com.caucho.vfs
Class Jar.ZipStreamImpl

java.lang.Object
  extended by com.caucho.vfs.StreamImpl
      extended by com.caucho.vfs.Jar.ZipStreamImpl
Enclosing class:
Jar

public class Jar.ZipStreamImpl
extends StreamImpl

StreamImpl to read from a ZIP file.


Field Summary
 
Fields inherited from class com.caucho.vfs.StreamImpl
_nullPath, _path
 
Method Summary
 boolean canRead()
          Returns true since this is a read stream.
 void close()
          Closes the stream.
 int getAvailable()
          Returns the number of bytes available without blocking.
 java.util.zip.ZipEntry getZipEntry()
           
 int read(byte[] buf, int off, int len)
          Reads the next chunk from the stream.
 
Methods inherited from class com.caucho.vfs.StreamImpl
canWrite, clearWrite, closeWrite, flush, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getZipEntry

public java.util.zip.ZipEntry getZipEntry()

canRead

public boolean canRead()
Returns true since this is a read stream.

Overrides:
canRead in class StreamImpl

getAvailable

public int getAvailable()
                 throws java.io.IOException
Description copied from class: StreamImpl
Returns the number of bytes available without blocking. Depending on the stream, this may return less than the actual bytes, but will always return a number > 0 if there is any data available.

Overrides:
getAvailable in class StreamImpl
Throws:
java.io.IOException

read

public int read(byte[] buf,
                int off,
                int len)
         throws java.io.IOException
Description copied from class: StreamImpl
Reads the next chunk from the stream.

Overrides:
read in class StreamImpl
Parameters:
buf - byte array receiving the data.
off - starting offset into the array.
len - number of bytes to read.
Returns:
the number of bytes read or -1 on end of file.
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from class: StreamImpl
Closes the stream.

Overrides:
close in class StreamImpl
Throws:
java.io.IOException