程序包 com.ajaxjs.util
类 StringBytes
java.lang.Object
com.ajaxjs.util.StringBytes
Convert String to bytes and bytes to String
Actually, you can use `new String(bytes)`/`str.getBytes()` more easily.
-
构造器详细资料
-
StringBytes
Constructor.- 参数:
string- String to convert.
-
StringBytes
public StringBytes(byte[] bytes) Constructor.- 参数:
bytes- Bytes to convert.
-
-
方法详细资料
-
getBytes
Convert String to bytes.- 参数:
charset- Charset to use.- 返回:
- Bytes
-
getBytes
public byte[] getBytes()Convert String to bytes. Uses platform default charset.- 返回:
- Bytes
-
getUTF8_Bytes
public byte[] getUTF8_Bytes()Convert String to bytes. Uses UTF-8 charset.- 返回:
- Bytes
-
getString
Convert bytes to String.- 参数:
charset- Charset to use.- 返回:
- String with given charset.
-
getString
Convert bytes to String. Uses platform default charset.- 返回:
- String with platform default charset.
-
getUTF8_String
Convert bytes to String. Uses UTF-8 charset.- 返回:
- String with UTF-8 charset.
-
showPlatformDefaultCharset
Show platform default charset.- 返回:
- Platform default charset.
-