protected void ensureOpen() throws IOException {
        if (this.closed) {
            throw new IOException(ERROR_STREAM_CLOSED);
        }
    }
Checks whether the input stream has been closed and throw an exception if it
is.

@throws IOException when the input stream has been closed
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseInputStream.java