public static ClickHouseOutputStream of(ClickHousePassThruStream stream, int bufferSize, Runnable postCloseAction) {
        if (stream == null || !stream.hasOutput()) {
            throw new IllegalArgumentException("Non-null pass-thru stream with output is required");
        }

        return stream.newOutputStream(bufferSize, postCloseAction);
    }
Wraps the given pass-thru stream as output stream.

@param stream          non-null pass-thru stream
@param postCloseAction custom action will be performed right after closing
                       the output stream
@param bufferSize      buffer size which is always greater than zero(usually
                       4096 or larger)
@return wrapped output
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseOutputStream.java