@ThreadSafe public class LockOutputStream extends DecoratingOutputStream
OutputShop
, via a Lock
object.LockInputStream
Modifier and Type | Field and Description |
---|---|
protected Lock |
lock
The object to synchronize on.
|
delegate
Constructor and Description |
---|
LockOutputStream(OutputStream out,
Lock lock)
Constructs a new synchronized output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
toString, write
protected final Lock lock
@CreatesObligation public LockOutputStream(@Nullable @WillCloseWhenClosed OutputStream out, Lock lock)
out
- the output stream to wrap in this decorator.lock
- the object to synchronize on.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class DecoratingOutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class DecoratingOutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class DecoratingOutputStream
IOException
public void write(int b) throws IOException
write
in class DecoratingOutputStream
IOException
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.