public class SynchronizedOutputStream extends DecoratingOutputStream
OutputStream
via an object provided to its constructor.SynchronizedInputStream| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
lock
The object to synchronize on - never
null. |
delegate| Constructor and Description |
|---|
SynchronizedOutputStream(java.io.OutputStream out)
Constructs a new synchronized output stream.
|
SynchronizedOutputStream(java.io.OutputStream out,
java.lang.Object lock)
Constructs a new synchronized output stream.
|
public SynchronizedOutputStream(java.io.OutputStream out)
out - the output stream to wrap in this decorator.public SynchronizedOutputStream(java.io.OutputStream out,
java.lang.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 java.io.IOException
write in class DecoratingOutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class DecoratingOutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class DecoratingOutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class DecoratingOutputStreamjava.io.IOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.