private void print()

in src/main/java/org/apache/commons/csv/CSVFormat.java [2151:2169]


    private void print(final InputStream inputStream, final Appendable out, final boolean newRecord) throws IOException {
        // InputStream is never null here
        // There is nothing to escape when quoting is used which is the default.
        if (!newRecord) {
            append(getDelimiterString(), out);
        }
        final boolean quoteCharacterSet = isQuoteCharacterSet();
        if (quoteCharacterSet) {
            append(getQuoteCharacter().charValue(), out); // Explicit (un)boxing is intentional
        }
        // Stream the input to the output without reading or holding the whole value in memory.
        // AppendableOutputStream cannot "close" an Appendable.
        try (OutputStream outputStream = new Base64OutputStream(new AppendableOutputStream<>(out))) {
            IOUtils.copy(inputStream, outputStream);
        }
        if (quoteCharacterSet) {
            append(getQuoteCharacter().charValue(), out); // Explicit (un)boxing is intentional
        }
    }