@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) 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(@Nullable OutputStream out)
out - the output stream to wrap in this decorator.public SynchronizedOutputStream(@Nullable OutputStream out, @CheckForNull 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 close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class DecoratingOutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class DecoratingOutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class DecoratingOutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class DecoratingOutputStreamIOExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.