org.xnio.streams
Class BufferPipeOutputStream
java.lang.Object
java.io.OutputStream
org.xnio.streams.BufferPipeOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class BufferPipeOutputStream
- extends OutputStream
An OutputStream implementation which writes out ByteBuffers to a consumer.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BufferPipeOutputStream
public BufferPipeOutputStream(BufferPipeOutputStream.BufferWriter bufferWriterTask)
throws IOException
- Construct a new instance. The internal buffers will have a capacity of
bufferSize. The
given bufferWriterTask will be called to send buffers, flush the output stream, and handle the
end-of-file condition.
- Parameters:
bufferWriterTask - the writer task
- Throws:
IOException - if an error occurs while initializing the stream
write
public void write(int b)
throws IOException
-
- Specified by:
write in class OutputStream
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
-
- Overrides:
write in class OutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
-
- Specified by:
flush in interface Flushable- Overrides:
flush in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
-
- Specified by:
close in interface Closeable- Overrides:
close in class OutputStream
- Throws:
IOException
Copyright © 2010 JBoss, a division of Red Hat, Inc.