org.apache.commons.httpclient
public class HttpConstants extends Object
Deprecated: use EncodingUtil class
HTTP content conversion routines.Field Summary | |
---|---|
static String | DEFAULT_CONTENT_CHARSET Default content encoding chatset |
static String | HTTP_ELEMENT_CHARSET Character set used to encode HTTP protocol elements |
Method Summary | |
---|---|
static byte[] | getAsciiBytes(String data)
Converts the specified string to byte array of ASCII characters.
|
static String | getAsciiString(byte[] data, int offset, int length)
Converts the byte array of ASCII characters to a string. |
static String | getAsciiString(byte[] data)
Converts the byte array of ASCII characters to a string. |
static byte[] | getBytes(String data)
Converts the specified string to a byte array of HTTP element characters.
|
static byte[] | getContentBytes(String data, 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 byte[] | getContentBytes(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 String | getContentString(byte[] data, int offset, int length, 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 String | getContentString(byte[] data, 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 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 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 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)
|
static 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)
|
Parameters: data the string to be encoded
Returns: The string as a byte array.
Parameters: data the byte array to be encoded offset the index of the first byte to encode length the number of bytes to encode
Returns: The string representation of the byte array
Parameters: data the byte array to be encoded
Returns: The string representation of the byte array
Parameters: data the string to be encoded
Returns: The resulting byte array.
Parameters: data the string to be encoded charset the desired character encoding
Returns: The resulting byte array.
Parameters: data the string to be encoded
Returns: The byte array as above.
Parameters: data the byte array to be encoded offset the index of the first byte to encode length the number of bytes to encode charset the desired character encoding
Returns: The result of the conversion.
Parameters: data the byte array to be encoded charset the desired character encoding
Returns: The result of the conversion.
Parameters: data the byte array to be encoded offset the index of the first byte to encode length the number of bytes to encode
Returns: The string representation of the byte array.
Parameters: data the byte array to be encoded
Returns: The string representation of the byte array.
Parameters: data the byte array to be encoded offset the index of the first byte to encode length the number of bytes to encode
Returns: The resulting string.
Parameters: data the byte array to be encoded
Returns: The resulting string.