| java.lang.Object org.apache.commons.httpclient.HttpConstants
HttpConstants | public class HttpConstants (Code) | | HTTP content conversion routines.
author: Oleg Kalnichevski author: Mike Bowler |
Method Summary | |
public static byte[] | getAsciiBytes(String data) Converts the specified string to byte array of ASCII characters. | public static String | getAsciiString(byte[] data, int offset, int length) Converts the byte array of ASCII characters to a string. | public static String | getAsciiString(byte[] data) Converts the byte array of ASCII characters to a string. | public static byte[] | getBytes(String data) Converts the specified string to a byte array of HTTP element characters. | public static byte[] | getContentBytes(String data, String charset) | public static byte[] | getContentBytes(String data) | public static String | getContentString(byte[] data, int offset, int length, String charset) | public static String | getContentString(byte[] data, String charset) | public static String | getContentString(byte[] data, int offset, int length) | public static String | getContentString(byte[] data) | public static String | getString(byte[] data, int offset, int length) | public static String | getString(byte[] data) |
DEFAULT_CONTENT_CHARSET | final public static String DEFAULT_CONTENT_CHARSET(Code) | | Default content encoding chatset
|
HTTP_ELEMENT_CHARSET | final public static String HTTP_ELEMENT_CHARSET(Code) | | Character set used to encode HTTP protocol elements
|
getAsciiBytes | public static byte[] getAsciiBytes(String data)(Code) | | Converts the specified string to byte array of ASCII characters.
Parameters: data - the string to be encoded The string as a byte array. |
getAsciiString | public static String getAsciiString(byte[] data, int offset, int length)(Code) | | Converts the byte array of ASCII characters to a string. This method is
to be used when decoding content of HTTP elements (such as response
headers)
Parameters: data - the byte array to be encoded Parameters: offset - the index of the first byte to encode Parameters: length - the number of bytes to encode The string representation of the byte array |
getAsciiString | public static String getAsciiString(byte[] data)(Code) | | Converts the byte array of ASCII characters to a string. This method is
to be used when decoding content of HTTP elements (such as response
headers)
Parameters: data - the byte array to be encoded The string representation of the byte array |
getBytes | public static byte[] getBytes(String data)(Code) | | Converts the specified string to a byte array of HTTP element characters.
This method is to be used when encoding content of HTTP elements (such as
request headers)
Parameters: data - the string to be encoded The resulting byte array. |
getContentBytes | public static byte[] getContentBytes(String data, String charset)(Code) | | 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
Parameters: data - the string to be encoded Parameters: charset - the desired character encoding The resulting byte array. |
getContentBytes | public static byte[] getContentBytes(String data)(Code) | | 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
Parameters: data - the string to be encoded The byte array as above. |
getContentString | public static String getContentString(byte[] data, int offset, int length, String charset)(Code) | | 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
Parameters: data - the byte array to be encoded Parameters: offset - the index of the first byte to encode Parameters: length - the number of bytes to encode Parameters: charset - the desired character encoding The result of the conversion. |
getContentString | public static String getContentString(byte[] data, String charset)(Code) | | 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
Parameters: data - the byte array to be encoded Parameters: charset - the desired character encoding The result of the conversion. |
getContentString | public static String getContentString(byte[] data, int offset, int length)(Code) | | 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
Parameters: data - the byte array to be encoded Parameters: offset - the index of the first byte to encode Parameters: length - the number of bytes to encode The string representation of the byte array. |
getContentString | public static String getContentString(byte[] data)(Code) | | 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
Parameters: data - the byte array to be encoded The string representation of the byte array. |
getString | public static String getString(byte[] data, int offset, int length)(Code) | | 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 byte array to be encoded Parameters: offset - the index of the first byte to encode Parameters: length - the number of bytes to encode The resulting string. |
getString | public static String getString(byte[] data)(Code) | | 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 byte array to be encoded The resulting string. |
|
|