title: Using chronicle map and byte[] or byte buffer
body: <p>I am trying to create a Chronicle map with a Long key and a variable sized byte[], a serialized Java BitSet to be precise. I can create a map at using Values interface, but the size of the array in it is fixed. </p>
  
  <p>So, I am looking to use byte[] or Bytebuffer since they are dynamically sized, thus saving memory. Is this a supported use case? Is there an example of using chronicle map with byte[] or ByteBuffer value classes? The following code fails </p>
  
  <pre><code>ChronicleMap&lt;Long, ByteBuffer&gt; map = ChronicleMap
      .of(Long.class, ByteBuffer.class)
      .name("shard_map")
      .averageValueSize(1000)
      .entries(1_000_000)
      .create();
  
  ByteBuffer ts2 = ByteBuffer.allocateDirect(10);
  ts2.putInt(10);
  map.put(1L, ts2);
  System.out.println(map.get(1L).getInt());
  </code></pre>
  
  <p>with the error:</p>
  
  <pre><code>Exception in thread "main" java.nio.BufferUnderflowException
      at java.nio.Buffer.nextGetIndex(Buffer.java:506)
      at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:361)
  </code></pre>
  
  <p>I have tried creating the value object with Values.newHeapInstance, but that fails with the error:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: class java.nio.ByteBuffer is not an interface nor a generated class native or heap class
      at net.openhft.chronicle.values.ValueModel.notValueInterfaceOfImpl(ValueModel.java:68)
      at net.openhft.chronicle.values.ValueModel.lambda$acquire$0(ValueModel.java:64)
      at net.openhft.chronicle.values.ValueModel.doSomethingForInterfaceOr(ValueModel.java:85)
      at net.openhft.chronicle.values.ValueModel.acquire(ValueModel.java:63)
      at net.openhft.chronicle.values.Values.heapClassFor(Values.java:68)
      at net.openhft.chronicle.values.Values.newHeapInstance(Values.java:37)
  </code></pre>
  
  <p>The documentation says that byte[] and ByteBuffer are supported out of the box, but I couldn't find a working example for it, so decided to ask here.</p>