title: Parse C byte array into Java ByteBuffer.
body: <p>I'm parsing a byte array which contains variables of different types. I'm getting this array from HID connected to my phone. Array was made by C programmer. I'm trying to parse it using ByteBuffer class:</p>
  
  <pre><code>byte[] buffer = new byte[64];
  if(connection.bulkTransfer(endpoint, buffer, 64, 1000) &gt;= 0)
  {
      ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
      char mId = byteBuffer.getChar();
      short rId = byteBuffer.getShort();
      // ............................
  }
  </code></pre>
  
  <p>But the values of this variables are not correct. Can anyone please tell me what i'm doing wrong?</p>