long end=System.currentTimeMillis()+60*10; InputStreamReader fileInputStream=new InputStreamReader(System.in); BufferedReader bufferedReader=new Buffered
The only reliable way would be to start a worker thread and do the actual reading inside it, while the caller thread would monitor the latency.
If the worker thread is waiting longer that allowed, the master thread would terminate it and throw an exception.