Example #1
0
 /**
  * Return a byte buffer that represents this Value with the following order:
  *
  * <ol>
  *   <li><strong>type</strong> - position 0
  *   <li><strong>data</strong> - position 1
  * </ol>
  *
  * @return the ByteBuffer representation
  */
 @Override
 public ByteBuffer getBytes() {
   if (bytes == null) {
     bytes = ByteBuffer.allocate(size());
     copyTo(bytes);
     bytes.rewind();
   }
   return ByteBuffers.asReadOnlyBuffer(bytes);
 }
 @Override
 public ByteBuffer getBytes() {
   return ByteBuffers.asReadOnlyBuffer(bytes);
 }