convert byte array to string java code example
Example 1: java convert bytes to string
byte[] bytes = "hello".getBytes();
String s = new String(bytes, StandardCharsets.UTF_8);
Example 2: String by byte array in java
String str = "Example String";
byte[] b = str.getBytes();
Example 3: convert byte array to string
byte[] byteArray1 = { 80, 65, 78, 75, 65, 74 };
String str = new String(byteArray1, 0, 3, StandardCharsets.UTF_8);