code: public static ByteBuffer createByteBuffer(int capacity) {
          return ByteBuffer.allocateDirect(capacity * DataType.BYTE.getByteSize()).order(ByteOrder.nativeOrder());
      }
docs: Creates a byte buffer of the desired capacity.
  
  @param capacity The capacity
  @return The byte buffer