public final class BufferedWriterDecorator extends Object implements ByteArrayWriter
ByteArrayWriter implementation. Data will be finally written if
either the buffer is full or flush() or close() is called.| Constructor and Description |
|---|
BufferedWriterDecorator(ByteArrayWriter writer) |
| 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 BufferedWriterDecorator(ByteArrayWriter writer)
writer - Underlying writerpublic void write(byte[] data,
int length)
throws IOException
ByteArrayWriterwrite in interface ByteArrayWriterdata - Byte array to outputlength - Number of bytes to outputIOException - Writing failedpublic void flush()
throws IOException
ByteArrayWriterflush in interface ByteArrayWriterIOException - Writing failedpublic void close()
throws IOException
ByteArrayWriterclose in interface ByteArrayWriterIOException - Closing failedCopyright © 2020. All rights reserved.