public class AsyncBufferedOutputStream extends FilterOutputStream
FilterOutputStream that forwards data asynchronously (with a background thread) to the delegate
OutputStream.out| Constructor and Description |
|---|
AsyncBufferedOutputStream(OutputStream out,
ByteBuffer buffer,
boolean fair) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
write(byte[] ba,
int off,
int len) |
void |
write(int b) |
writepublic AsyncBufferedOutputStream(OutputStream out, ByteBuffer buffer, boolean fair)
buffer - Typically ByteBuffer.allocate(capacity) for a heap buffer or ByteBuffer.allocateDirect(capacity) for an off-heap bufferfair - See ReentrantLockpublic void write(int b)
throws IOException
write in class FilterOutputStreamIOException - The background thread got this exceptionpublic void write(byte[] ba,
int off,
int len)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class FilterOutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionCopyright © 2018 Arno Unkrig. All rights reserved.