How to convert a byte array to a string and print it?
<p>My byte array contains the following data:</p>

<pre><code>7 0 5 0 0 0 5 0 5 0 5 0 5 0 5 0 5 0 0 0
</code></pre>

<p>I want to convert this to a string such that the string is "\x07\x00\x05\x00..." (each element in the sequence represents the numeric value of an ASCII character in the string). Another example: <code>97 98 99</code> should be converted to "abc".</p>

<p>I am using:</p>

<pre><code>String s = new String(byteArray,4);
System.out.println(s);
</code></pre>

<p>but the output is some non printable characters:</p>

<pre><code>:ЇЀЅЀЀЀЅЀЅЀЅЀЅЀЅЀЅЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀЀ
</code></pre>

<p>Even when I change the encoding in (byteArray, somenumber) I was getting the same result (non printable characters). How can I fix this?</p>
