@Test
  public void testPutPrimitives() {
    ByteBuffer bb = ByteBuffer.allocate(10);
    SingleByteBuff s = new SingleByteBuff(bb);
    s.putLong(-4465109508325701663L);
    bb.rewind();
    long long1 = bb.getLong();
    assertEquals(-4465109508325701663L, long1);
    s.position(8);
  }
Test right answer though we span many sub-buffers.
hbase-common/src/test/java/org/apache/hadoop/hbase/nio/TestMultiByteBuff.java