private int readNextByte() {
    try {
      return myReader.read();
    }
    catch (IOException e) {
      return -1; // When process terminated Process.getInputStream()'s underlaying stream becomes closed on Linux.
    }
  }
private int readNextByte()