org.jboss.virtual.plugins.context.zip
Class ZipEntryInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.jboss.virtual.plugins.context.zip.ZipEntryInputStream
All Implemented Interfaces:
Closeable

public class ZipEntryInputStream
extends InputStream

ZipEntryInputStream is part of ZipFileWrapper implementation. It wraps the stream retrieved from ZipFile.getInputStream(entry) and releases the underlying ZipFileWrapper when detecting end of use.

Version:
$Revision: 1.0 $
Author:
Marko Strukelj

Method Summary
 int available()
           
 void close()
          Close this stream and release zipWrapper
protected  void finalize()
          Properly release held resources
 void mark(int readlimit)
           
 int read()
          Read one byte.
 int read(byte[] buf)
          Read a buffer of bytes.
 int read(byte[] buf, int off, int len)
          Read a buffer of bytes.
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.InputStream
markSupported
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public int read()
         throws IOException
Read one byte.

Specified by:
read in class InputStream
Returns:
whatever the underlying input stream returns
Throws:
IOException - for any error
See Also:
InputStream.read()

read

public int read(byte[] buf)
         throws IOException
Read a buffer of bytes.

Overrides:
read in class InputStream
Parameters:
buf - read buffer
Returns:
whatever the underlying input stream returns
Throws:
IOException - for any error
See Also:
InputStream.read(byte[])

read

public int read(byte[] buf,
                int off,
                int len)
         throws IOException
Read a buffer of bytes.

Overrides:
read in class InputStream
Parameters:
buf - read buffer
off - position within buffer to start reading at
len - maximum bytes to read
Returns:
whatever the underlying input stream returns
Throws:
IOException - for any error
See Also:
InputStream.read(byte[],int,int)

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException
See Also:
InputStream.reset()

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream
See Also:
InputStream.mark(int)

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException
See Also:
InputStream.available()

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException
See Also:
InputStream.skip(long)

close

public void close()
           throws IOException
Close this stream and release zipWrapper

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException
See Also:
InputStream.close()

finalize

protected void finalize()
                 throws Throwable
Properly release held resources

Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2011 JBoss, A division of Red Hat, Inc. All Rights Reserved.