static int getBufferSize(int bufferSize, int defaultSize, int maxSize) {
        if (maxSize < 1 || maxSize > DEFAULT_MAX_BUFFER_SIZE) {
            maxSize = DEFAULT_MAX_BUFFER_SIZE;
        }
        if (defaultSize < 1) {
            defaultSize = DEFAULT_BUFFER_SIZE;
        } else if (defaultSize > maxSize) {
            defaultSize = maxSize;
        }

        if (bufferSize < 1) {
            return defaultSize;
        }

        return bufferSize > maxSize ? maxSize : bufferSize;
    }
Gets buffer size.

@param bufferSize  suggested buffer size, zero or negative number is treated
                   as {@code defaultSize}
@param defaultSize default buffer size, zero or negative number is treated as
                   {@link #DEFAULT_BUFFER_SIZE}
@param maxSize     maximum buffer size, zero or negative number is treated as
                   {@link #DEFAULT_MAX_BUFFER_SIZE}
@return buffer size
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseDataConfig.java