public class BufferPipeOutputStream extends OutputStream
OutputStream
implementation which writes out ByteBuffer
s to a consumer.Modifier and Type | Class and Description |
---|---|
static interface |
BufferPipeOutputStream.BufferWriter
A buffer writer for an
BufferPipeOutputStream . |
Constructor and Description |
---|
BufferPipeOutputStream(BufferPipeOutputStream.BufferWriter bufferWriterTask)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
Pooled<ByteBuffer> |
breakPipe()
Break the pipe and return any filling pooled buffer.
|
void |
close() |
void |
flush() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
write
public BufferPipeOutputStream(BufferPipeOutputStream.BufferWriter bufferWriterTask) throws IOException
bufferSize
. The
given bufferWriterTask
will be called to send buffers, flush the output stream, and handle the
end-of-file condition.bufferWriterTask
- the writer taskIOException
- if an error occurs while initializing the streampublic void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public Pooled<ByteBuffer> breakPipe()
BufferPipeOutputStream.BufferWriter.accept(org.xnio.Pooled, boolean)
are
unblocked, preferably with a BrokenPipeException
.null
if none was pendingCopyright © 2018 JBoss by Red Hat. All rights reserved.