| java.lang.Object org.apache.http.util.EncodingUtils
EncodingUtils | final public class EncodingUtils (Code) | | The home for utility methods that handle various encoding tasks.
author: Michael Becke author: Oleg Kalnichevski since: 4.0 |
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, String charset) Converts the specified string to a byte array. | public static String | getString(byte[] data, int offset, int length, String charset) Converts the byte array of HTTP content characters to a string. | public static String | getString(byte[] data, String charset) Converts the byte array of HTTP content characters to a string. |
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, String charset)(Code) | | Converts the specified string to a byte array. If the charset is not supported the
default system charset is used.
Parameters: data - the string to be encoded Parameters: charset - the desired character encoding The resulting byte array. |
getString | public static String getString(byte[] data, int offset, int length, String charset)(Code) | | Converts the byte array of HTTP content characters to a string. If
the specified charset is not supported, default system encoding
is used.
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. |
getString | public static String getString(byte[] data, String charset)(Code) | | Converts the byte array of HTTP content characters to a string. If
the specified charset is not supported, default system encoding
is used.
Parameters: data - the byte array to be encoded Parameters: charset - the desired character encoding The result of the conversion. |
|
|