I have a java application that reads input from another program written in C++. The C++ program runs as a Windows Service and will invoke a Java application bundled as a jar. The C++ and Java programs communiate over Standard In and Standard Out. We have found an issue and narrowed it down to how the Java program reads data from Standard In. The Java program will some times lock up when reading data on the readLine() method. The Java program will work fine when it reads data from a file for input.
What is the best/correct way to read data from Standard Input from Java?
Currently this is how we are reading data:
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader bf = new BufferedReader(isr);