|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpConstants
HTTP content conversion routines.
Field Summary | |
static java.lang.String |
DEFAULT_CONTENT_CHARSET
Default content encoding chatset |
static java.lang.String |
HTTP_ELEMENT_CHARSET
Character set used to encode HTTP protocol elements |
Constructor Summary | |
HttpConstants()
|
Method Summary | |
static byte[] |
getAsciiBytes(java.lang.String data)
Converts the specified string to byte array of ASCII characters. |
static java.lang.String |
getAsciiString(byte[] data)
Converts the byte array of ASCII characters to a string. |
static java.lang.String |
getAsciiString(byte[] data,
int offset,
int length)
Converts the byte array of ASCII characters to a string. |
static byte[] |
getBytes(java.lang.String data)
Converts the specified string to a byte array of HTTP element characters. |
static byte[] |
getContentBytes(java.lang.String data)
Converts the specified string to a byte array of HTTP content characters using default HTTP content encoding (ISO-8859-1) This method is to be used when encoding content of HTTP request/response |
static byte[] |
getContentBytes(java.lang.String data,
java.lang.String charset)
Converts the specified string to a byte array of HTTP content charachetrs This method is to be used when encoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied |
static java.lang.String |
getContentString(byte[] data)
Converts the byte array of HTTP content characters to a string using default HTTP content encoding (ISO-8859-1) This method is to be used when decoding content of HTTP request/response |
static java.lang.String |
getContentString(byte[] data,
int offset,
int length)
Converts the byte array of HTTP content characters to a string using default HTTP content encoding (ISO-8859-1) This method is to be used when decoding content of HTTP request/response |
static java.lang.String |
getContentString(byte[] data,
int offset,
int length,
java.lang.String charset)
Converts the byte array of HTTP content characters to a string This method is to be used when decoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied |
static java.lang.String |
getContentString(byte[] data,
java.lang.String charset)
Converts the byte array of HTTP content characters to a string This method is to be used when decoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied |
static java.lang.String |
getString(byte[] data)
Converts the byte array of HTTP element characters to a string This method is to be used when decoding content of HTTP elements (such as response headers) |
static java.lang.String |
getString(byte[] data,
int offset,
int length)
Converts the byte array of HTTP element characters to a string This method is to be used when decoding content of HTTP elements (such as response headers) |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String HTTP_ELEMENT_CHARSET
public static final java.lang.String DEFAULT_CONTENT_CHARSET
Constructor Detail |
public HttpConstants()
Method Detail |
public static byte[] getBytes(java.lang.String data)
data
- the string to be encodedpublic static java.lang.String getString(byte[] data, int offset, int length)
data
- the byte array to be encodedoffset
- the index of the first byte to encodelength
- the number of bytes to encodepublic static java.lang.String getString(byte[] data)
data
- the byte array to be encodedpublic static byte[] getContentBytes(java.lang.String data, java.lang.String charset)
data
- the string to be encodedcharset
- the desired character encodingpublic static java.lang.String getContentString(byte[] data, int offset, int length, java.lang.String charset)
data
- the byte array to be encodedoffset
- the index of the first byte to encodelength
- the number of bytes to encodecharset
- the desired character encodingpublic static java.lang.String getContentString(byte[] data, java.lang.String charset)
data
- the byte array to be encodedcharset
- the desired character encodingpublic static byte[] getContentBytes(java.lang.String data)
data
- the string to be encodedpublic static java.lang.String getContentString(byte[] data, int offset, int length)
data
- the byte array to be encodedoffset
- the index of the first byte to encodelength
- the number of bytes to encodepublic static java.lang.String getContentString(byte[] data)
data
- the byte array to be encodedpublic static byte[] getAsciiBytes(java.lang.String data)
data
- the string to be encodedpublic static java.lang.String getAsciiString(byte[] data, int offset, int length)
data
- the byte array to be encodedoffset
- the index of the first byte to encodelength
- the number of bytes to encodepublic static java.lang.String getAsciiString(byte[] data)
data
- the byte array to be encoded
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |