|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SessionOutputBuffer
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 Summary | |
---|---|
int |
flush(java.nio.channels.WritableByteChannel channel)
Makes an attempt to flush the content of this buffer to the given destination WritableByteChannel . |
boolean |
hasData()
Determines if the buffer contains data. |
int |
length()
Returns the length of this buffer. |
void |
write(java.nio.ByteBuffer src)
Copies content of the source buffer into this buffer. |
void |
write(java.nio.channels.ReadableByteChannel src)
Reads a sequence of bytes from the source channel into this buffer. |
void |
writeLine(CharArrayBuffer src)
Copies content of the source buffer into this buffer as one line of text including a line delimiter. |
void |
writeLine(java.lang.String s)
Copies content of the given string into this buffer as one line of text including a line delimiter. |
Method Detail |
---|
boolean hasData()
true
if there is data in the buffer,
false
otherwise.int length()
int flush(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
WritableByteChannel
.
channel
- the destination channel.
java.io.IOException
- in case of an I/O error.void write(java.nio.ByteBuffer src)
src
- the source buffer.void write(java.nio.channels.ReadableByteChannel src) throws java.io.IOException
src
- the source channel.
java.io.IOException
void writeLine(CharArrayBuffer src) throws java.nio.charset.CharacterCodingException
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
src
- the source buffer.
java.nio.charset.CharacterCodingException
void writeLine(java.lang.String s) throws java.io.IOException
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
s
- the string.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |