|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.proxy.utils.IoBufferDecoder
public class IoBufferDecoder
IoBufferDecoder.java - Handles an IoBuffer decoder which supports two methods :
- dynamic delimiter decoding
- fixed length content reading
| Nested Class Summary | |
|---|---|
class |
IoBufferDecoder.DecodingContext
|
| Constructor Summary | |
|---|---|
IoBufferDecoder(byte[] delimiter)
Creates a new instance that uses specified delimiter byte array as a message delimiter. |
|
IoBufferDecoder(int contentLength)
Creates a new instance that will read messages of contentLength bytes. |
|
| Method Summary | |
|---|---|
IoBuffer |
decodeFully(IoBuffer in)
Will return null unless it has enough data to decode. |
void |
setContentLength(int contentLength,
boolean resetMatchCount)
Sets the the length of the content line to be decoded. |
void |
setDelimiter(byte[] delim,
boolean resetMatchCount)
Dynamically sets a new delimiter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IoBufferDecoder(byte[] delimiter)
public IoBufferDecoder(int contentLength)
| Method Detail |
|---|
public void setContentLength(int contentLength,
boolean resetMatchCount)
public void setDelimiter(byte[] delim,
boolean resetMatchCount)
IoBufferDecoder#decodeOnce(IoSession, int) will be called it will use the new
delimiter. Delimiter matching is reset only if resetMatchCount is true but
decoding will continue from current position.
NB : Delimiter LineDelimiter.AUTO is not allowed.
public IoBuffer decodeFully(IoBuffer in)
contentLength
is set then it tries to retrieve contentLength bytes from the buffer
otherwise it will scan the buffer to find the data delimiter and return
all the data and the trailing delimiter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||