public void write(ClickHouseValue value) throws IOException {
        if (output == null) {
            throw new IllegalStateException("No output stream available to write");
        }
        DefaultSerDe s = getInitializedSerDe();
        int len = s.columns.length;
        int pos = writePosition;
        if (len == 0 || pos >= len) {
            throw new IllegalStateException(
                    ClickHouseUtils.format("No column to write(total=%d, writePosition=%d)", len, pos));
        }
        if (value == null) {
            value = config.isReuseValueWrapper() ? s.templates[pos] : s.templates[pos].copy();
        }
        s.serializers[pos++].serialize(value, output);
        writePosition = pos >= len ? 0 : pos;
    }
Writes serialized value of next column(at {@code readPosition}) to output
stream.

@param value non-null value to be serialized
@throws IOException when failed to write data to output stream
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseDataProcessor.java