docs: public static byte[] copyBytesFrom(ByteBuffer bb) {
          if (bb == null) {
              return null;
          }
  
          if (bb.hasArray()) {
              return Arrays.copyOfRange(
                      bb.array(),
                      bb.arrayOffset() + bb.position(),
                      bb.arrayOffset() + bb.limit());
          }
  
          byte[] dst = new byte[bb.remaining()];
          bb.asReadOnlyBuffer().get(dst);
          return dst;
      }