public ClickHouseOutputStream writeString(String value, Charset charset) throws IOException {
        if (value == null || value.isEmpty()) {
            return writeByte((byte) 0);
        } else {
            byte[] bytes = value.getBytes(charset != null ? charset : StandardCharsets.UTF_8);
            int len = bytes.length;
            writeVarInt(len);
            return writeBytes(bytes, 0, len);
        }
    }
Writes string into the output stream. Nothing will happen when {@code value}
is
null or empty.

@param value   string to write
@param charset charset, null is treated as {@link StandardCharsets#UTF_8}
@return this output stream
@throws IOException when failed to write value into output stream, not able
                    to sent all bytes, or operate on a closed stream
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseOutputStream.java