Package org.xnio.streams
Interface BufferPipeOutputStream.BufferWriter
- All Superinterfaces:
Flushable
- Enclosing class:
BufferPipeOutputStream
A buffer writer for an
BufferPipeOutputStream
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(Pooled<ByteBuffer> pooledBuffer, boolean eof) Accept a buffer.void
flush()
Flushes this stream by writing any buffered output to the underlying stream.getBuffer
(boolean firstBuffer) Get a new buffer to be filled.
-
Method Details
-
getBuffer
Get a new buffer to be filled. The new buffer may, for example, include a prepended header. This method may block until a buffer is available or until some other condition, such as flow control, is met.- Parameters:
firstBuffer
-true
if this is the first buffer in the stream,false
otherwise- Returns:
- the new buffer
- Throws:
IOException
- if an I/O error occurs
-
accept
Accept a buffer. If this is the last buffer that will be sent, theeof
flag will be set totrue
. This method should block until the entire buffer is consumed, or an error occurs. This method may also block until some other condition, such as flow control, is met.- Parameters:
pooledBuffer
- the buffer to sendeof
-true
if this is the last buffer which will be sent- Throws:
IOException
- if an I/O error occurs
-
flush
Flushes this stream by writing any buffered output to the underlying stream. This method should block until the data is fully flushed. This method may also block until some other condition, such as flow control, is met.- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
- If an I/O error occurs
-