Save This Page
Home » HttpComponents-Core-4.0.1 » org.apache.http.nio.reactor » [javadoc | source]
org.apache.http.nio.reactor
public interface: SessionOutputBuffer [javadoc | source]

All Known Implementing Classes:
    SessionOutputBufferImpl

Session output buffer for non-blocking connections. This interface facilitates intermediate buffering of output data streamed out to a destination channel and writing data to the buffer from a source, usually ByteBuffer or ReadableByteChannel . This interface also provides methods for writing lines of text.
Method from org.apache.http.nio.reactor.SessionOutputBuffer Summary:
flush,   hasData,   length,   write,   write,   writeLine,   writeLine
Method from org.apache.http.nio.reactor.SessionOutputBuffer Detail:
 public int flush(WritableByteChannel channel) throws IOException
    Makes an attempt to flush the content of this buffer to the given destination WritableByteChannel .
 public boolean hasData()
    Determines if the buffer contains data.
 public int length()
    Returns the length of this buffer.
 public  void write(ByteBuffer src)
    Copies content of the source buffer into this buffer. The capacity of the destination will be expanded in order to accommodate the entire content of the source buffer.
 public  void write(ReadableByteChannel src) throws IOException
    Reads a sequence of bytes from the source channel into this buffer.
 public  void writeLine(CharArrayBuffer src) throws CharacterCodingException
    Copies content of the source buffer into this buffer as one line of text including a line delimiter. The capacity of the destination will be expanded in order to accommodate the entire content of the source buffer.

    The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.

 public  void writeLine(String s) throws IOException
    Copies content of the given string into this buffer as one line of text including a line delimiter. The capacity of the destination will be expanded in order to accommodate the entire string.

    The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.