Build 1.0_r1(from source)

java.util.zip
Class ZipFile.RAFStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.util.zip.ZipFile.RAFStream
All Implemented Interfaces:
Closeable
Enclosing class:
ZipFile

static class ZipFile.RAFStream
extends InputStream


Field Summary
(package private)  long mLength
           
(package private)  long mOffset
           
(package private)  RandomAccessFile mSharedRaf
           
 
Constructor Summary
ZipFile.RAFStream(RandomAccessFile raf, long pos)
           
 
Method Summary
 int available()
          Returns a int representing then number of bytes that are available before this InputStream will block.
 int read()
          Reads a single byte from this InputStream and returns the result as an int.
 int read(byte[] b, int off, int len)
          Reads at most length bytes from the Stream and stores them in byte array b starting at offset.
 long skip(long n)
          Skips n number of bytes in this InputStream.
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mSharedRaf

RandomAccessFile mSharedRaf

mOffset

long mOffset

mLength

long mLength
Constructor Detail

ZipFile.RAFStream

public ZipFile.RAFStream(RandomAccessFile raf,
                         long pos)
                  throws IOException
Throws:
IOException
Method Detail

available

public int available()
              throws IOException
Description copied from class: InputStream
Returns a int representing then number of bytes that are available before this InputStream will block. This method always returns 0. Subclasses should override and indicate the correct number of bytes available.

Overrides:
available in class InputStream
Returns:
the number of bytes available before blocking.
Throws:
IOException - If an error occurs in this InputStream.

read

public int read()
         throws IOException
Description copied from class: InputStream
Reads a single byte from this InputStream and returns the result as an int. The low-order byte is returned or -1 of the end of stream was encountered. This abstract implementation must be provided by concrete subclasses.

Specified by:
read in class InputStream
Returns:
the byte read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Description copied from class: InputStream
Reads at most length bytes from the Stream and stores them in byte array b starting at offset. Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered.

Overrides:
read in class InputStream
Parameters:
b - the byte array in which to store the read bytes.
off - the offset in b to store the read bytes.
len - the maximum number of bytes to store in b.
Returns:
the number of bytes actually read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

skip

public long skip(long n)
          throws IOException
Description copied from class: InputStream
Skips n number of bytes in this InputStream. Subsequent read()'s will not return these bytes unless reset() is used. This method may perform multiple reads to read n bytes. This default implementation reads n bytes into a temporary buffer. Concrete subclasses should provide their own implementation.

Overrides:
skip in class InputStream
Parameters:
n - the number of bytes to skip.
Returns:
the number of bytes actually skipped.
Throws:
IOException - If the stream is already closed or another IOException occurs.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature