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

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

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