字节与字符串的操作
将字节数组变成字符串: new string (byte[])
字符串转字节数组:str.getByte()
字符串部分转字节数组:
字节不适合处理中文
字节与字符串的操作
将字节数组变成字符串: new string (byte[])
字符串转字节数组:str.getByte()
字符串部分转字节数组:
字节不适合处理中文
字节:数据传输或者编码转换
支持:
构造方法:
public String(byte[] byte)
public String(byte[] byte, int offset, int length)
普通方法:
public byte[] getBytes()
public byte[] getBytes(String charsetName) throws UnsupportedEncodingException //编码转换
字节 -128 到 127 无法表示中文
字符才用于表示中文