public final class CharsetUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
asciiBytesToChars(byte[] bytes,
int offset,
int length,
char[] chars)
Decodes the given US-ASCII bytes into the given char[].
|
static void |
isoLatin1BytesToChars(byte[] bytes,
int offset,
int length,
char[] chars)
Decodes the given ISO-8859-1 bytes into the given char[].
|
static byte[] |
toAsciiBytes(String s,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the characters in the given
string, encoded in US-ASCII.
|
static byte[] |
toBigEndianUtf16Bytes(String s,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the characters in the given
string, encoded in UTF-16BE.
|
static byte[] |
toIsoLatin1Bytes(String s,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the characters in the given
string, encoded in ISO-8859-1.
|
static byte[] |
toUtf8Bytes(String s,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the characters in the given
string, encoded in UTF-8.
|
public static byte[] toAsciiBytes(String s, int offset, int length)
public static byte[] toIsoLatin1Bytes(String s, int offset, int length)
public static byte[] toUtf8Bytes(String s, int offset, int length)
public static byte[] toBigEndianUtf16Bytes(String s, int offset, int length)
public static void asciiBytesToChars(byte[] bytes,
int offset,
int length,
char[] chars)
public static void isoLatin1BytesToChars(byte[] bytes,
int offset,
int length,
char[] chars)