JBoss Marshalling 1.2.1.GA

org.jboss.marshalling
Interface NioByteOutput.BufferWriter

All Superinterfaces:
Flushable
Enclosing class:
NioByteOutput

public static interface NioByteOutput.BufferWriter
extends Flushable

A buffer writer for an NioByteOutput.


Method Summary
 void accept(ByteBuffer buffer, boolean eof)
          Accept a buffer.
 void flush()
          Flushes this stream by writing any buffered output to the underlying stream.
 ByteBuffer getBuffer()
          Get a new buffer to be filled.
 

Method Detail

getBuffer

ByteBuffer getBuffer()
Get a new buffer to be filled. The new buffer may, for example, include a prepended header.

Returns:
the new buffer

accept

void accept(ByteBuffer buffer,
            boolean eof)
            throws IOException
Accept a buffer. If this is the last buffer that will be sent, the eof flag will be set to true. This method should block until the entire buffer is consumed, or an error occurs.

Parameters:
buffer - the buffer to send
eof - true if this is the last buffer which will be sent
Throws:
IOException - if an I/O error occurs

flush

void flush()
           throws IOException
Flushes this stream by writing any buffered output to the underlying stream. This method should block until the data is fully flushed.

Specified by:
flush in interface Flushable
Throws:
IOException - If an I/O error occurs

JBoss Marshalling 1.2.1.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.