static ByteBuff createByteBuffer(int len, int val, boolean useHeap) {
    ByteBuffer b = useHeap ? ByteBuffer.allocate(2 * len) : ByteBuffer.allocateDirect(2 * len);
    int pos = (int) (Math.random() * len);
    b.position(pos).limit(pos + len);
    for (int i = pos; i < pos + len; i++) {
      b.put(i, (byte) val);
    }
    return ByteBuff.wrap(b);
  }
A CacheableDeserializer implementation which just store reference to the {@link ByteBuff} to be
deserialized.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java