public class StringUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
UTF8_CHARSET_ENCODING |
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
charsetDecodeString(String strToDecode,
String charsetEncoding)
Converts a string to an array of byte according to a given charset encoding
|
static byte[] |
charsetDecodeStringUTF8(String strToDecode)
Converts the given string to an array of byte based on UTF8 encoding
|
static String |
charsetEncodeBytes(byte[] byteArrToEncode,
String charsetEncoding)
Converts the sequence of bytes to string according to the given charset encoding.
|
static String |
charsetEncodeBytesUTF8(byte[] byteArrToEncode)
Converts the sequence of bytes to string according to UTF-8 charset encoding.
|
static String |
concat(String... strings)
Concatenates a sequence of string using StringBuilder should be used instead of s1+s2+s3+s4+s5.....
|
public static final String UTF8_CHARSET_ENCODING
public static String charsetEncodeBytesUTF8(byte[] byteArrToEncode)
byteArrToEncode
- array of bytes that holds the data that will be used to create the stringpublic static String charsetEncodeBytes(byte[] byteArrToEncode, String charsetEncoding)
byteArrToEncode
- the array of bytes that holds the data that will be used to create the stringcharsetEncoding
- the charset encodign to be usedpublic static byte[] charsetDecodeString(String strToDecode, String charsetEncoding)
strToDecode
- the string to decodecharsetEncoding
- the charset encoding to usepublic static byte[] charsetDecodeStringUTF8(String strToDecode)
strToDecode
- the string to convertCopyright © 2012. All Rights Reserved.