public final class Charsets extends Object
| Modifier and Type | Field and Description |
|---|---|
static Charset |
LATIN_1
The
8859_1 character set. |
static Charset |
UTF_8
The
UTF-8 character set. |
| Modifier and Type | Method and Description |
|---|---|
static int |
encodedLengthOf(String src)
Get the encoded length of a string.
|
static boolean |
encodeTo(String src,
byte[] dest,
int offs)
Encode a string into UTF-8 (except encoding character zero to its two-byte form).
|
static int |
indexOf(byte[] array,
int search)
Find the first occurrence of a byte in a byte array.
|
static int |
indexOf(byte[] array,
int search,
int offs)
Find the first occurrence of a byte in a byte array.
|
static int |
indexOf(byte[] array,
int search,
int offs,
int len)
Find the first occurrence of a byte in a byte array.
|
public static final Charset UTF_8
UTF-8 character set.public static final Charset LATIN_1
8859_1 character set.public static boolean encodeTo(String src, byte[] dest, int offs)
src - the source stringdest - the array to encode tooffs - the offset into the destination arraytrue if the string fit, false if it did notpublic static int encodedLengthOf(String src)
src - the stringpublic static int indexOf(byte[] array,
int search,
int offs,
int len)
array - the array to searchsearch - the byte to search foroffs - the offset in the array to start searchinglen - the length of the segment to searchpublic static int indexOf(byte[] array,
int search,
int offs)
array - the array to searchsearch - the byte to search foroffs - the offset in the array to start searchingpublic static int indexOf(byte[] array,
int search)
array - the array to searchsearch - the byte to search forCopyright © 2012 JBoss by Red Hat. All Rights Reserved.