de.schlichtherle.io
Class OutputArchiveMetaData.EntryOutputStream
java.lang.Object
java.io.OutputStream
de.schlichtherle.io.util.SynchronizedOutputStream
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
|
closed
private boolean closed
OutputArchiveMetaData.EntryOutputStream
private OutputArchiveMetaData.EntryOutputStream(OutputStream out)
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
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.