public class SessionOutputBufferImpl extends ExpandableBuffer implements SessionOutputBuffer
SessionOutputBuffer
based on
the ExpandableBuffer
class.Modifier and Type | Field and Description |
---|---|
private CharBuffer |
charbuffer |
private CharsetEncoder |
charencoder |
private static byte[] |
CRLF |
private int |
lineBuffersize |
buffer, INPUT_MODE, OUTPUT_MODE
Constructor and Description |
---|
SessionOutputBufferImpl(int buffersize) |
SessionOutputBufferImpl(int buffersize,
int linebuffersize) |
SessionOutputBufferImpl(int buffersize,
int lineBuffersize,
ByteBufferAllocator allocator,
HttpParams params)
Deprecated.
|
SessionOutputBufferImpl(int buffersize,
int linebuffersize,
Charset charset) |
SessionOutputBufferImpl(int buffersize,
int lineBuffersize,
CharsetEncoder charencoder,
ByteBufferAllocator allocator)
Creates SessionOutputBufferImpl instance.
|
SessionOutputBufferImpl(int buffersize,
int linebuffersize,
HttpParams params)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
flush(WritableByteChannel channel)
Makes an attempt to flush the content of this buffer to the given
destination
WritableByteChannel . |
void |
reset(HttpParams params) |
private void |
write(byte[] b) |
void |
write(ByteBuffer src)
Copies content of the source buffer into this buffer.
|
void |
write(ReadableByteChannel src)
Reads a sequence of bytes from the source channel into this buffer.
|
private void |
writeCRLF() |
void |
writeLine(CharArrayBuffer linebuffer)
Copies content of the source buffer into this buffer as one line of text
including a line delimiter.
|
void |
writeLine(String s)
Copies content of the given string into this buffer as one line of text
including a line delimiter.
|
available, capacity, clear, ensureCapacity, expand, getMode, hasData, length, setInputMode, setOutputMode, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
hasData, length
private static final byte[] CRLF
private final CharsetEncoder charencoder
private final int lineBuffersize
private CharBuffer charbuffer
public SessionOutputBufferImpl(int buffersize, int lineBuffersize, CharsetEncoder charencoder, ByteBufferAllocator allocator)
buffersize
- input buffer sizelineBuffersize
- buffer size for line operations. Has effect only if
charencoder
is not null
.charencoder
- charencoder to be used for encoding HTTP protocol elements.
If null
simple type cast will be used for char to byte conversion.allocator
- memory allocator.
If null
HeapByteBufferAllocator.INSTANCE
will be used.@Deprecated public SessionOutputBufferImpl(int buffersize, int lineBuffersize, ByteBufferAllocator allocator, HttpParams params)
SessionOutputBufferImpl(int, int, CharsetEncoder,
ByteBufferAllocator)
@Deprecated public SessionOutputBufferImpl(int buffersize, int linebuffersize, HttpParams params)
SessionOutputBufferImpl(int, int, Charset)
public SessionOutputBufferImpl(int buffersize)
public SessionOutputBufferImpl(int buffersize, int linebuffersize, Charset charset)
public SessionOutputBufferImpl(int buffersize, int linebuffersize)
public void reset(HttpParams params)
public int flush(WritableByteChannel channel) throws IOException
SessionOutputBuffer
WritableByteChannel
.flush
in interface SessionOutputBuffer
channel
- the destination channel.IOException
- in case of an I/O error.public void write(ByteBuffer src)
SessionOutputBuffer
write
in interface SessionOutputBuffer
src
- the source buffer.public void write(ReadableByteChannel src) throws IOException
SessionOutputBuffer
write
in interface SessionOutputBuffer
src
- the source channel.IOException
private void write(byte[] b)
private void writeCRLF()
public void writeLine(CharArrayBuffer linebuffer) throws CharacterCodingException
SessionOutputBuffer
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
writeLine
in interface SessionOutputBuffer
linebuffer
- the source buffer.CharacterCodingException
public void writeLine(String s) throws IOException
SessionOutputBuffer
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
writeLine
in interface SessionOutputBuffer
s
- the string.IOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses