public final class CharsetUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getUtf8Bytes(String s)
A clean version of String#getBytes that does not throw exceptions for
the UTF-8 Charset.
|
static String |
newUtf8String(byte[] b)
A clean version of new String(byte[], "UTF-8")
Replace all callers with new String(b, Charsets.UTF_8) when
we move to Java 6.
|
public static byte[] getUtf8Bytes(String s)
s - a string to convertpublic static String newUtf8String(byte[] b)
b - a byte array of UTF-8 bytesCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.