Is it possible to read from a InputStream with a timeout?
Using inputStream.available() It is always acceptable for System.in.available() to return 0. I’ve found the opposite – it always returns the best value for the number of bytes available. Javadoc for InputStream.available(): Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next … Read more