public class SynchronizedOutputStream extends DecoratingOutputStream
OutputStream
via an object provided to its constructor.SynchronizedInputStream| Modifier and Type | Field and Description |
|---|---|
protected Object |
lock
The object to synchronize on - never
null. |
delegate| Constructor and Description |
|---|
SynchronizedOutputStream(OutputStream out)
Constructs a new synchronized output stream.
|
SynchronizedOutputStream(OutputStream out,
Object lock)
Constructs a new synchronized output stream.
|
protected final Object lock
null.public SynchronizedOutputStream(OutputStream out)
out - the output stream to wrap in this decorator.public SynchronizedOutputStream(OutputStream out, Object lock)
out - the output stream to wrap in this decorator.lock - the object to synchronize on.
If null, then this object is used, not the stream.public void write(int b)
throws IOException
write in class DecoratingOutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class DecoratingOutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class DecoratingOutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class DecoratingOutputStreamIOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.