title: How to update a byte buffer
body: <p>I want to know if it's possible to update a byte buffer.</p>
  
  <p>Say I have the below:</p>
  
  <pre><code>ByteBuffer buffer = ByteBuffer.allocate(56);
  buffer.putInt(12);
  buffer.putLong(34);    
  buffer.put(byte('A'));    
  </code></pre>
  
  <p>Assuming I want to modify the buffer to say the that first int I put in should be 50, how do I do that.</p>
  
  <p>I want something like:</p>
  
  <pre><code>public void updateByteBuffer(ByteBuffer, int position, int newValue){
    // logic to change buffer.putInt(12); to buffer.putInt(50);
    // So after this function, my ByteBuffer should contain(hex) 50,34 and 'A';
  }
  </code></pre>