public final class EncodingUtils extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
getAsciiBytes(String data)
Converts the specified string to byte array of ASCII characters.
|
static String |
getAsciiString(byte[] data)
Converts the byte array of ASCII characters to a string.
|
static String |
getAsciiString(byte[] data,
int offset,
int length)
Converts the byte array of ASCII characters to a string.
|
static byte[] |
getBytes(String data,
String charset)
Converts the specified string to a byte array.
|
static String |
getString(byte[] data,
int offset,
int length,
String charset)
Converts the byte array of HTTP content characters to a string.
|
static String |
getString(byte[] data,
String charset)
Converts the byte array of HTTP content characters to a string.
|
public static String getString(byte[] data, int offset, int length, 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 String getString(byte[] data, String charset)
data
- the byte array to be encodedcharset
- the desired character encodingpublic static byte[] getBytes(String data, String charset)
data
- the string to be encodedcharset
- the desired character encodingpublic static byte[] getAsciiBytes(String data)
data
- the string to be encodedpublic static 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 String getAsciiString(byte[] data)
data
- the byte array to be encodedCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.