This class is immutable and thread-safe.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static byte[] | Returns: the encoded bytesThe string to encode (if null, return null). string, final Charset The charset)Charset to encode the StringCalls |
| public static byte[] | Returns: encoded bytes, ornull if the input string was nullthe String to encode, may be string)nullEncodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte array. |
| private static String | Returns: A newString decoded from the specified array of bytes using the given charset,
or null if the input byte array was null.The bytes to be decoded into characters bytes, final Charset charset)Constructs a new |
| public static String | Returns: A newString decoded from the specified array of bytes using the US-ASCII charset,
or null if the input byte array was null.The bytes to be decoded into characters bytes)Constructs a new |
| public static String | Returns: A newString decoded from the specified array of bytes using the UTF-8 charset,
or null if the input byte array was null.The bytes to be decoded into characters bytes)Constructs a new |
| StringUtils | back to summary |
|---|---|
| public StringUtils() | |
| getBytes | back to summary |
|---|---|
| private static byte[] getBytes(final String string, final Charset charset) Calls | |
| getBytesUtf8 | back to summary |
|---|---|
| public static byte[] getBytesUtf8(final String string) Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte array.
| |
| newString | back to summary |
|---|---|
| private static String newString(final byte[] bytes, final Charset charset) Constructs a new
| |
| newStringUsAscii | back to summary |
|---|---|
| public static String newStringUsAscii(final byte[] bytes) Constructs a new
| |
| newStringUtf8 | back to summary |
|---|---|
| public static String newStringUtf8(final byte[] bytes) Constructs a new
| |