@Override
    public void stop() {
        log.trace("Stopping");
        synchronized (this) {
            try {
                if (stream != null && stream != System.in) {
                    stream.close();
                    log.trace("Closed input stream");
                }
            } catch (IOException e) {
                log.error("Failed to close FileStreamSourceTask stream: ", e);
            }
            this.notify();
        }
    }
FileStreamSourceTask reads from stdin or a file.
connect/file/src/main/java/org/apache/kafka/connect/file/FileStreamSourceTask.java