public final class EncodingUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
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,
java.lang.String charset)
Converts the specified string to a byte array.
|
static java.lang.String |
getString(byte[] data,
int offset,
int length,
java.lang.String charset)
Converts the byte array of HTTP content characters to a string.
|
static java.lang.String |
getString(byte[] data,
java.lang.String charset)
Converts the byte array of HTTP content characters to a string.
|
public static java.lang.String getString(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 getString(byte[] data, java.lang.String charset)
data
- the byte array to be encodedcharset
- the desired character encodingpublic static byte[] getBytes(java.lang.String data, java.lang.String charset)
data
- the string to be encodedcharset
- the desired character encodingpublic 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