|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.nio.util.ExpandableBuffer org.apache.http.impl.nio.reactor.SessionOutputBufferImpl
public class SessionOutputBufferImpl
Default implementation of SessionOutputBuffer
based on
the ExpandableBuffer
class.
Field Summary |
---|
Fields inherited from class org.apache.http.nio.util.ExpandableBuffer |
---|
buffer, INPUT_MODE, OUTPUT_MODE |
Constructor Summary | |
---|---|
SessionOutputBufferImpl(int bufferSize)
Creates SessionOutputBufferImpl instance. |
|
SessionOutputBufferImpl(int bufferSize,
int lineBufferSize)
Creates SessionOutputBufferImpl instance. |
|
SessionOutputBufferImpl(int bufferSize,
int lineBufferSize,
ByteBufferAllocator allocator,
HttpParams params)
Deprecated. (4.3) use SessionOutputBufferImpl(int, int, CharsetEncoder,
ByteBufferAllocator) |
|
SessionOutputBufferImpl(int bufferSize,
int lineBufferSize,
Charset charset)
Creates SessionOutputBufferImpl instance. |
|
SessionOutputBufferImpl(int bufferSize,
int lineBufferSize,
CharsetEncoder charEncoder,
ByteBufferAllocator allocator)
Creates SessionOutputBufferImpl instance. |
|
SessionOutputBufferImpl(int bufferSize,
int lineBufferSize,
HttpParams params)
Deprecated. (4.3) use SessionOutputBufferImpl(int, int, Charset) |
Method Summary | |
---|---|
int |
flush(WritableByteChannel channel)
Makes an attempt to flush the content of this buffer to the given destination WritableByteChannel . |
void |
reset(HttpParams params)
|
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. |
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. |
Methods inherited from class org.apache.http.nio.util.ExpandableBuffer |
---|
available, capacity, clear, ensureCapacity, expand, getMode, hasData, length, setInputMode, setOutputMode, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.http.nio.reactor.SessionOutputBuffer |
---|
hasData, length |
Constructor Detail |
---|
public SessionOutputBufferImpl(int bufferSize, int lineBufferSize, CharsetEncoder charEncoder, ByteBufferAllocator allocator)
bufferSize
- input buffer size.lineBufferSize
- 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)
bufferSize
- input buffer size.public SessionOutputBufferImpl(int bufferSize, int lineBufferSize, Charset charset)
bufferSize
- input buffer size.lineBufferSize
- buffer size for line operations. Has effect only if
charset
is not null
.charset
- Charset to be used for encoding HTTP protocol elements.
If null
simple type cast will be used for char to byte conversion.public SessionOutputBufferImpl(int bufferSize, int lineBufferSize)
bufferSize
- input buffer size.lineBufferSize
- buffer size for line operations.Method Detail |
---|
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
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |