title: int to bufferbyte
body: <p>I have the following:</p>
  
  <pre><code>byte[] l = ByteBuffer.allocate(16).putInt(N).array();
  </code></pre>
  
  <p>but it puts the bytes at the beggining of the array and not to the end of it
  how do i put it to the end?
  I've tried the following too:</p>
  
  <pre><code>byte[] l = ByteBuffer.allocate(16).putInt(15 - (int)Math.ceil((Math.log(N)/Math.log(2))/8), N * 8).array();
  </code></pre>
  
  <p>but seems to work with some numbers, but in others get an ArrayIndexOutOfBoundsIndexException (they are lower than 2<sup>16</sup>)</p>