code: public static byte[] asArray(ByteBuffer byteBuffer) {
          ByteBuffer bb = ByteBufferUtil.clone(byteBuffer);
          byte[] bytes = new byte[bb.remaining()];
          bb.get(bytes);
          return bytes;
      }
docs: Returns the specified {@link java.nio.ByteBuffer} as a byte array.
  
  @param byteBuffer a {@link java.nio.ByteBuffer} to be converted to a byte array.
  @return the byte array representation of the {@code byteBuffer}.