|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.littleshoot.util.mina.MinaCodecUtils
public class MinaCodecUtils
Taken from AsyncWeb. Utilies for SIP codec handling.
| Field Summary | |
|---|---|
static byte |
AMP
Ampersand character |
static byte |
BACK_SLASH
Back-slash character |
static byte |
COLON
Colon character |
static byte |
COMMA
Comma. |
static byte |
CR
Carriage return character |
static String |
DEFAULT_CHARACTER_ENCODING
The default charset we employ |
static byte |
EQUALS
Equals character |
static byte |
FOWARD_SLASH
Foward-slash character |
static byte |
HT
Horizontal tab character |
static byte |
LF
Line feed character |
static byte |
PERCENT
Percent character |
static byte |
PLUS
Plus character |
static byte |
QS
Question mark character |
static byte |
QUOTE
Quote character |
static byte |
SEMI_COLON
Semi-colon |
static byte |
SPACE
Space character |
| Constructor Summary | |
|---|---|
MinaCodecUtils()
|
|
| Method Summary | |
|---|---|
static void |
appendCRLF(org.littleshoot.mina.common.ByteBuffer buffer)
Appends a CR LF to the specified buffer |
static void |
appendString(org.littleshoot.mina.common.ByteBuffer buffer,
String string)
Appends a string to a specified ByteBuffer. |
static byte[] |
getAsciiBytes(String str)
Returns the ASCII bytes for a specified string. |
static int |
hexAsciiToDecimal(byte b)
Obtains the decimal value for a hex value encoded in ASCII |
static boolean |
isHex(byte b)
Determines whether a specified (US-ASCII) character is a valid hex character: A..F a..f 0..9 |
static boolean |
isHttpControl(byte b)
Determines whether a specified (US-ASCII) character is an HTTP control character |
static boolean |
isHttpSeparator(byte b)
Determines whether a specified (US-ASCII) character is an HTTP field separator |
static boolean |
isWhiteSpace(byte b)
Determines whether a specified (US-ASCII) character is an HTTP whitespace character (Space or Horizontal tab) |
static void |
pushBack(org.littleshoot.mina.common.ByteBuffer buffer)
"Pushes back" a byte on to the specified buffer, by rewinding the position by 1 byte |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_CHARACTER_ENCODING
public static final byte AMP
public static final byte COLON
public static final byte CR
public static final byte EQUALS
public static final byte LF
public static final byte SPACE
public static final byte PLUS
public static final byte QS
public static final byte HT
public static final byte PERCENT
public static final byte FOWARD_SLASH
public static final byte BACK_SLASH
public static final byte QUOTE
public static final byte SEMI_COLON
public static final byte COMMA
| Constructor Detail |
|---|
public MinaCodecUtils()
| Method Detail |
|---|
public static boolean isHex(byte b)
b - The character to check
true iff the character is a valid hex characterpublic static boolean isHttpSeparator(byte b)
b - The US-ASCII character to check
true iff the character is an HTTP field separatorpublic static boolean isHttpControl(byte b)
b - The US-ASCII character to check
true iff the character is an HTTP control
characterpublic static boolean isWhiteSpace(byte b)
b - the US-ASCII character to check
true iff the character is an HTTP whitespace
characterpublic static void pushBack(org.littleshoot.mina.common.ByteBuffer buffer)
buffer - The buffer to "push back" topublic static int hexAsciiToDecimal(byte b)
b - The ASCII encoded byte
-1 if the specified byte is
not a valid ASCII hex characterpublic static byte[] getAsciiBytes(String str)
str - The string
public static void appendString(org.littleshoot.mina.common.ByteBuffer buffer,
String string)
ByteBuffer. This method assumes
ascii encoding and is primarily used for encoding http header names and
values.
buffer - The buffer to append tostring - The string to appendpublic static void appendCRLF(org.littleshoot.mina.common.ByteBuffer buffer)
CR LF to the specified buffer
buffer - The buffer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||