public class StringUtil extends Object
| Constructor and Description |
|---|
StringUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getString(byte[] bytes)
Returns the String representation of the given modified UTF-8 byte array.
|
static String |
getStringRepresentation(byte[] bytes,
int size)
Returns the String representation of the given modified UTF-8 byte array.
|
static byte[] |
getUtf8Bytes(String string)
Returns the modified UTF-8 byte array representation of the given string.
|
static String |
join(String separator,
String... strings)
Joins the given strings using the provided separator.
|
static String |
toHexString(byte[] bytes)
Returns the hexadecimal representation of the given byte array.
|
static String |
toHexString(byte[] bytes,
int size)
Returns the hexadecimal representation of the given byte array.
|
public static byte[] getUtf8Bytes(String string)
public static String getString(byte[] bytes) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String getStringRepresentation(byte[] bytes, int size) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String join(String separator, String... strings)
separator - The separator to use.strings - The strings to join.public static String toHexString(byte[] bytes)
public static String toHexString(byte[] bytes, int size)
Copyright © 2019. All rights reserved.