Java中String与byte[]的变换
Java中String与byte[]的转换
- String -> byte[]: byte[] bytes = s.getBytes();
- byte[] -> String: String str = new String(bytes);