public ByteArrayBuilder charset(final Charset charset) {
        if (charset == null) {
            this.charsetEncoder = null;
        } else {
            this.charsetEncoder = charset.newEncoder()
                    .onMalformedInput(CodingErrorAction.IGNORE)
                    .onUnmappableCharacter(CodingErrorAction.REPLACE);
        }
        return this;
    }
Builder class for sequences of bytes.

@since 5.0
httpclient5/src/main/java/org/apache/hc/client5/http/utils/ByteArrayBuilder.java