public final class Charsets extends Object
Modifier and Type | Field and Description |
---|---|
static Charset |
ISO_8859_1
A cheap and type-safe constant for the ISO-8859-1 Charset.
|
static Charset |
US_ASCII
A cheap and type-safe constant for the US-ASCII Charset.
|
static Charset |
UTF_8
A cheap and type-safe constant for the UTF-8 Charset.
|
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(char[] chars,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the given characters,
encoded in US-ASCII.
|
static byte[] |
toBigEndianUtf16Bytes(char[] chars,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the given characters,
encoded in UTF-16BE.
|
static byte[] |
toIsoLatin1Bytes(char[] chars,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the given characters,
encoded in ISO-8859-1.
|
static byte[] |
toUtf8Bytes(char[] chars,
int offset,
int length)
Returns a new byte array containing the bytes corresponding to the given characters,
encoded in UTF-8.
|
public static final Charset ISO_8859_1
public static final Charset US_ASCII
public static final Charset UTF_8
public static byte[] toAsciiBytes(char[] chars, int offset, int length)
public static byte[] toIsoLatin1Bytes(char[] chars, int offset, int length)
public static byte[] toUtf8Bytes(char[] chars, int offset, int length)
public static byte[] toBigEndianUtf16Bytes(char[] chars, 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)