|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.mimo.netty.handler.codec.icap.IcapDecoderUtil
public final class IcapDecoderUtil
Utility that provides decoding support for ICAP messages.
Method Summary | |
---|---|
static int |
findEndOfString(String sb)
finds the end of a string. |
static int |
findNonWhitespace(String sb,
int offset)
finds the first occurrence of a non whitespace character. |
static int |
findWhitespace(String sb,
int offset)
finds the first occurrence of a whitespace character |
static int |
getChunkSize(String line)
parses the chunk size from a line. |
static boolean |
isHeaderLineSimpleValue(String header)
|
static String |
previewLine(org.jboss.netty.buffer.ChannelBuffer buffer,
int maxLineLength)
previews a line until CR / LF / CRLF this will not increas the buffers readerIndex! |
static List<String[]> |
readHeaders(org.jboss.netty.buffer.ChannelBuffer buffer,
int maxSize)
parses all available message headers. |
static String |
readLine(org.jboss.netty.buffer.ChannelBuffer buffer,
int maxLineLength)
reads a line until CR / LF / CRLF |
static String |
readSingleHeaderLine(org.jboss.netty.buffer.ChannelBuffer buffer,
SizeDelimiter sizeDelimiter)
reads one individual header "key: value" |
static void |
skipControlCharacters(org.jboss.netty.buffer.ChannelBuffer buffer)
finds the true beginning of the request by skipping all prepended control and whitespace characters. |
static String[] |
splitHeader(String sb)
Splits one header into key|value |
static String[] |
splitInitialLine(String sb)
Splits an initial line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void skipControlCharacters(org.jboss.netty.buffer.ChannelBuffer buffer)
buffer
- public static String readLine(org.jboss.netty.buffer.ChannelBuffer buffer, int maxLineLength) throws DecodingException
buffer
- maxLineLength
-
org.jboss.netty.handler.codec.frame.TooLongFrameException
DecodingException
public static String previewLine(org.jboss.netty.buffer.ChannelBuffer buffer, int maxLineLength) throws DecodingException
buffer
- maxLineLength
-
DecodingException
public static String[] splitInitialLine(String sb)
sb
-
public static int findNonWhitespace(String sb, int offset)
sb
- string to find non-whitespaces inoffset
- the offset to start searching from.
public static int findWhitespace(String sb, int offset)
sb
- string to find whitespaces in.offset
- to search from within the string.
public static int findEndOfString(String sb)
sb
- string to find the end from
public static int getChunkSize(String line) throws DecodingException
line
-
DecodingException
public static List<String[]> readHeaders(org.jboss.netty.buffer.ChannelBuffer buffer, int maxSize) throws DecodingException
buffer
- @see ChannelBuffer
that contains the headers.maxSize
- the maximum size of all headers concatenated.
org.jboss.netty.handler.codec.frame.TooLongFrameException
- if the maximum size is reached.
DecodingException
public static boolean isHeaderLineSimpleValue(String header)
public static String readSingleHeaderLine(org.jboss.netty.buffer.ChannelBuffer buffer, SizeDelimiter sizeDelimiter) throws DecodingException
buffer
- which contains the request streamsizeDelimiter
- the current header size, accumulated for all headers.
org.jboss.netty.handler.codec.frame.TooLongFrameException
- In case the total header length is exceeded.
DecodingException
public static String[] splitHeader(String sb)
sb
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |