How to convert byte array to string

edited April 2016 in Java
byte[] b = new byte[5];
    b[0] = 97;
    b[1] = -68;
       b[3] = 4;

System.out.println (new String (b, "ISO-8859-1"));

Here, 4 is in ASCII and -68 is having extended ascii char. that 4 is not getting printed any string


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion