TrueZIP 6.8.2

de.schlichtherle.io
Class OutputArchiveMetaData.EntryOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.schlichtherle.io.util.SynchronizedOutputStream
          extended by de.schlichtherle.io.OutputArchiveMetaData.EntryOutputStream
All Implemented Interfaces:
Closeable, Flushable
Enclosing class:
OutputArchiveMetaData

private final class OutputArchiveMetaData.EntryOutputStream
extends SynchronizedOutputStream

An OutputStream to write the entry data to an OutputArchive. This output stream provides support for finalization and throws an IOException on any subsequent attempt to write data after OutputArchiveMetaData.closeAllOutputStreams(de.schlichtherle.io.ArchiveException) has been called.


Field Summary
private  boolean closed
           
 
Fields inherited from class de.schlichtherle.io.util.SynchronizedOutputStream
lock, out
 
Constructor Summary
private OutputArchiveMetaData.EntryOutputStream(OutputStream out)
           
 
Method Summary
 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 output stream to close.
 void flush()
          Synchronizes on the SynchronizedOutputStream.lock and calls SynchronizedOutputStream.doFlush().
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class de.schlichtherle.io.util.SynchronizedOutputStream
doFlush
 
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

OutputArchiveMetaData.EntryOutputStream

private OutputArchiveMetaData.EntryOutputStream(OutputStream out)
Method Detail

ensureNotStopped

private final void ensureNotStopped()
                             throws IOException
Throws:
IOException

write

public void write(int b)
           throws IOException
Overrides:
write in class SynchronizedOutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class SynchronizedOutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class SynchronizedOutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Description copied from class: SynchronizedOutputStream
Synchronizes on the SynchronizedOutputStream.lock and calls SynchronizedOutputStream.doFlush().

Specified by:
flush in interface Flushable
Overrides:
flush in class SynchronizedOutputStream
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 flushes and closes the underlying stream.

Specified by:
close in interface Closeable
Overrides:
close in class SynchronizedOutputStream
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 SynchronizedOutputStream
Throws:
IOException - If an I/O exception occurs.

finalize

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

Overrides:
finalize in class Object
Throws:
Throwable

TrueZIP 6.8.2

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