public byte[] toByteArray() {
        if (this.buffer == null) {
            return new byte[] {};
        }
        this.buffer.flip();
        final byte[] b = new byte[this.buffer.remaining()];
        this.buffer.get(b);
        this.buffer.clear();
        return b;
    }
Builder class for sequences of bytes.

@since 5.0
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/utils/ByteArrayBuilder.java