public final class SynchronizedWriterDecorator extends Object implements ByteArrayWriter
ByteArrayWriter
implementation.Constructor and Description |
---|
SynchronizedWriterDecorator(ByteArrayWriter writer,
Object mutex) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this writer and releases any associated system resources.
|
void |
flush()
Forces writing of any buffered data.
|
void |
write(byte[] data,
int length)
Outputs a byte array.
|
public SynchronizedWriterDecorator(ByteArrayWriter writer, Object mutex)
writer
- Underlying writermutex
- Mutex for synchronizedpublic void write(byte[] data, int length) throws IOException
ByteArrayWriter
write
in interface ByteArrayWriter
data
- Byte array to outputlength
- Number of bytes to outputIOException
- Writing failedpublic void flush() throws IOException
ByteArrayWriter
flush
in interface ByteArrayWriter
IOException
- Writing failedpublic void close() throws IOException
ByteArrayWriter
close
in interface ByteArrayWriter
IOException
- Closing failedCopyright © 2020. All rights reserved.