title: Java - CRC32.update() on concatenated ByteBuffer
body: <p>I have the following function:</p>
  
  <pre><code>   byte[] test1 = {1,2,3,4};
     byte[] test2 = {5,6,7,8};
     ByteBuffer bbtest1 = ByteBuffer.wrap(test1).order(ByteOrder.LITTLE_ENDIAN);
     ByteBuffer bbtest2= ByteBuffer.wrap(test2).order(ByteOrder.LITTLE_ENDIAN);
  
     ByteBuffer contents = ByteBuffer.allocate(bbtest1.limit() + bbtest2.limit());
     contents.put(bbtest1);
     contents.put(bbtest2);
  
     CRC32 checksum = new CRC32();
     checksum.update(contents);
  
     System.out.println(checksum.getValue());
  </code></pre>
  
  <p>No matter what values I assign my byte arrays, getValue() always returns 0 when I have concatenated by byteBuffers. According to <a href="https://stackoverflow.com/questions/30734268/concatenate-two-bytebuffers-to-a-single/30734513#30734513" title="this thread">this thread</a>, this is a valid way of concatenating byteBuffers. If I only call put() on a single byteBuffer (for example if I comment out the line <code>byte[] test2 = {5,6,7,8};</code> then getValue() actually returns a valid value.</p>
  
  <p>Is this an issue with the way the ByteBuffers are concatenated, update(ByteBuffer) performs on concatenated ByteBuffers, or maybe something else altogether?</p>