TrueZIP 6.8.3

de.schlichtherle.io
Class InputArchiveMetaData.EntryInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by de.schlichtherle.io.util.SynchronizedInputStream
          extended by de.schlichtherle.io.InputArchiveMetaData.EntryInputStream
All Implemented Interfaces:
Closeable
Enclosing class:
InputArchiveMetaData

private final class InputArchiveMetaData.EntryInputStream
extends SynchronizedInputStream

An InputStream to read the entry data from an InputArchive. This input stream provides support for finalization and throws an IOException on any subsequent attempt to read data after InputArchiveMetaData.closeAllInputStreams(de.schlichtherle.io.ArchiveException) has been called.


Field Summary
private  boolean closed
           
 
Fields inherited from class de.schlichtherle.io.util.SynchronizedInputStream
in, lock
 
Constructor Summary
private InputArchiveMetaData.EntryInputStream(InputStream in)
           
 
Method Summary
 int available()
           
 void close()
          Closes this archive entry stream and releases any resources associated with it.
protected  void doClose()
          Closes the underlying stream and marks this stream as being closed.
private  void ensureNotStopped()
           
protected  void finalize()
          The finalizer in this class forces this archive entry input stream to close.
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

closed

private boolean closed
Constructor Detail

InputArchiveMetaData.EntryInputStream

private InputArchiveMetaData.EntryInputStream(InputStream in)
Method Detail

ensureNotStopped

private final void ensureNotStopped()
                             throws IOException
Throws:
IOException

read

public int read()
         throws IOException
Overrides:
read in class SynchronizedInputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class SynchronizedInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class SynchronizedInputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class SynchronizedInputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class SynchronizedInputStream
Throws:
IOException

close

public final void close()
                 throws IOException
Closes this archive entry stream and releases any resources associated with it. This method tolerates multiple calls to it: Only the first invocation closes the underlying stream.

Specified by:
close in interface Closeable
Overrides:
close in class SynchronizedInputStream
Throws:
IOException - If an I/O exception occurs.

doClose

protected void doClose()
                throws IOException
Closes the underlying stream and marks this stream as being closed. It is an error to call this method on an already closed stream. This method does not remove this stream from the pool. This method is not synchronized!

Overrides:
doClose in class SynchronizedInputStream
Throws:
IOException - If an I/O exception occurs.

mark

public void mark(int readlimit)
Overrides:
mark in class SynchronizedInputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class SynchronizedInputStream
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class SynchronizedInputStream

finalize

protected void finalize()
                 throws Throwable
The finalizer in this class forces this archive entry input stream to close. This is used to ensure that an archive can be updated although the client may have "forgot" to close this input stream before.

Overrides:
finalize in class Object
Throws:
Throwable

TrueZIP 6.8.3

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