title: What is the safest way to use direct byte buffers in Java?
body: <p>Lets sat I have an object i'd like to store in a direct byte buffer.
  I'd like to able access parts of the object from the direct byte buffer without de-serializing the whole object. Is there a safe way to do this?</p>
  
  <p>I'm thinking you could somehow capture the byte array offsets when serializing the object, then once its been written to the direct byte buffer you would adjust these offsets according to the offset of the direct byte buffer. I'm not sure if its possible to do this...</p>