Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- int out = 0;
- String line;
- OutputStream stdin = null;
- InputStream stderr = null;
- InputStream stdout = null;
- // calling the exe file
- Process process = new ProcessBuilder("unpattern.exe").start();
- stdin = process.getOutputStream();
- stderr = process.getErrorStream();
- stdout = process.getInputStream();
- // input process
- // "write" the parms into stdin
- line = "1";
- stdin.write(line.getBytes());
- stdin.flush();
- //line = "tx.getText()" + "n";
- // stdin.write(line.getBytes());
- // stdin.flush();
- stdin.close();
- // output process
- // clean up if any output in stdout
- BufferedReader brCleanUp =
- new BufferedReader(new InputStreamReader(stdout));
- while ((line = brCleanUp.readLine()) != null) {
- // counter of the defects
- System.out.println(line);
- } catch (IOException ex) {
- Logger.getLogger(QeyeGui3.class.getName()).log(Level.SEVERE, null, ex);
- }
- // ....
- while ((line = brCleanUp.readLine()) != null) {
- // counter of the defects
- System.out.println(line);
- // **** it should go here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement