title: BufferWriter not converting integers above 383
body: <p>I'm trying to convert numbers to byte array form. There's a simple trick that goes like this:</p>
  
  <pre><code>int input = number;    
  byte[] bytes = ByteBuffer.allocate(4).putInt(input).array();
  
  for(int i = 0 ; i &lt; bytes.length ; i++)
              System.out.println(bytes[i]);
  </code></pre>
  
  <p>Works like a charm, except when I exceed integer value 383 (Bytes: 0 0 1 127), it automatically results in an array with integer value 319 (Bytes: 0 0 1 63) when writing it to a file:</p>
  
  <pre><code>BufferedWriter out;
  
  for(int i = 0 ; i &lt; input.length ; i++)
              out.write(input[i]);
  </code></pre>
  
  <p>Is there a solution to that?</p>