Write input to binaryfile and read it back as int (getting back decimal values)
<p>When writing to a binary file like this:</p>

<pre><code>byte[] content = {1,2,3};
FileOutputStream  output =   new FileOutputStream("data.bin");
DataOutputStream fileName = new DataOutputStream(output);
fileName.writeInt(content.length);
for (int i = 0; i &lt; content.length; i++)
{
fileName.writeInt(content[i]);
System.out.println(content[i]);
}
fileName.close();
</code></pre>

<p>When reading it back using FileInputStream/DataInputStream and .readInt() everything is ok.
(If i use .skip(4); because the first one seems to contain a value wich is the number of digits written)</p>

<p>However, if the byte[] content is replaced with input using scanner.</p>

<pre><code>java.util.Scanner in = new java.util.Scanner(System.in);
String inputAsString = in.nextLine();
byte[] content = inputAsString.getBytes();
</code></pre>

<p>I noticed it is written to the binaryfile in decimal. 1 becomes 49, 2 is 50, 3 is 51 ...
My question is how can i read it back to 1, 2, 3 just like the first example with the hardcoded byte array.</p>
