public class BufferPipeOutputStream
extends java.io.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<java.nio.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) |
public BufferPipeOutputStream(BufferPipeOutputStream.BufferWriter bufferWriterTask) throws java.io.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 taskjava.io.IOException
- if an error occurs while initializing the streampublic void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public Pooled<java.nio.ByteBuffer> breakPipe()
BufferPipeOutputStream.BufferWriter.accept(org.xnio.Pooled, boolean)
are
unblocked, preferably with a BrokenPipeException
.null
if none was pendingCopyright © 2016 JBoss, a division of Red Hat, Inc.