@NotThreadSafe public class SessionInputBufferImpl extends ExpandableBuffer implements SessionInputBuffer
SessionInputBuffer based on
the ExpandableBuffer class.
The following parameters can be used to customize the behavior of this class:
buffer, INPUT_MODE, OUTPUT_MODE| Constructor and Description |
|---|
SessionInputBufferImpl(int buffersize,
int linebuffersize,
ByteBufferAllocator allocator,
HttpParams params) |
SessionInputBufferImpl(int buffersize,
int linebuffersize,
HttpParams params) |
| Modifier and Type | Method and Description |
|---|---|
int |
fill(ReadableByteChannel channel)
Makes an attempt to fill the buffer with data from the given
ReadableByteChannel. |
int |
read()
Reads one byte from the buffer.
|
int |
read(ByteBuffer dst)
Reads a sequence of bytes from this buffer into the destination buffer.
|
int |
read(ByteBuffer dst,
int maxLen)
Reads a sequence of bytes from this buffer into the destination buffer,
up to the given maximum limit.
|
int |
read(WritableByteChannel dst)
Reads a sequence of bytes from this buffer into the destination channel.
|
int |
read(WritableByteChannel dst,
int maxLen)
Reads a sequence of bytes from this buffer into the destination channel,
up to the given maximum limit.
|
String |
readLine(boolean endOfStream)
Attempts to transfer a complete line of characters up to a line delimiter
from this buffer to a newly created string.
|
boolean |
readLine(CharArrayBuffer linebuffer,
boolean endOfStream)
Attempts to transfer a complete line of characters up to a line delimiter
from this buffer to the destination buffer.
|
available, capacity, clear, ensureCapacity, expand, getMode, hasData, length, setInputMode, setOutputMode, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasData, lengthpublic SessionInputBufferImpl(int buffersize,
int linebuffersize,
ByteBufferAllocator allocator,
HttpParams params)
public SessionInputBufferImpl(int buffersize,
int linebuffersize,
HttpParams params)
public int fill(ReadableByteChannel channel) throws IOException
SessionInputBufferReadableByteChannel.fill in interface SessionInputBufferchannel - the source channelIOException - in case of an I/O error.public int read()
SessionInputBufferread in interface SessionInputBufferpublic int read(ByteBuffer dst, int maxLen)
SessionInputBuffermaxLen value.read in interface SessionInputBufferdst - the destination buffer.maxLen - the maximum number of bytes to be read.public int read(ByteBuffer dst)
SessionInputBufferread in interface SessionInputBufferdst - the destination buffer.public int read(WritableByteChannel dst, int maxLen) throws IOException
SessionInputBuffermaxLen value.read in interface SessionInputBufferdst - the destination channel.maxLen - the maximum number of bytes to be read.IOException - in case of an I/O error.public int read(WritableByteChannel dst) throws IOException
SessionInputBufferread in interface SessionInputBufferdst - the destination channel.IOException - in case of an I/O error.public boolean readLine(CharArrayBuffer linebuffer, boolean endOfStream) throws CharacterCodingException
SessionInputBuffertrue. The line
delimiter itself is discarded. If a complete line is not available in
the buffer, this method returns false without transferring
anything to the destination buffer. If endOfStream parameter
is set to true this method assumes the end of stream has
been reached and the content currently stored in the buffer should be
treated as a complete line.
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
readLine in interface SessionInputBufferlinebuffer - the destination buffer.true if a sequence of chars representing a complete
line has been transferred to the destination buffer, false
otherwise.CharacterCodingException - in case a character encoding or decoding
error occurs.public String readLine(boolean endOfStream) throws CharacterCodingException
SessionInputBuffernull. If endOfStream parameter
is set to true this method assumes the end of stream has
been reached and the content currently stored in the buffer should be
treated as a complete line.
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
readLine in interface SessionInputBuffernull otherwise.CharacterCodingException - in case a character encoding or decoding
error occurs.Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.