private void doAppend(final CharBuffer charBuffer) {
        if (this.charsetEncoder == null) {
            this.charsetEncoder = StandardCharsets.US_ASCII.newEncoder()
                    .onMalformedInput(CodingErrorAction.IGNORE)
                    .onUnmappableCharacter(CodingErrorAction.REPLACE);
        }
        this.charsetEncoder.reset();
        try {
            this.buffer = encode(this.buffer, charBuffer, this.charsetEncoder);
        } catch (final CharacterCodingException ex) {
            // Should never happen
            throw new IllegalStateException("Unexpected character coding error", ex);
        }
    }
Builder class for sequences of bytes.

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