Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Process process = Runtime.getRuntime().exec("/home/username/Desktop/mosesdecoder/bin/moses -f /home/username/Desktop/mosesdecoder/model/moses.ini");
- while (true) {
- OutputStream stdin = null;
- InputStream stderr = null;
- InputStream stdout = null;
- stdin = process.getOutputStream();
- stderr = process.getErrorStream();
- stdout = process.getInputStream();
- // "write" the parms into stdin
- line = "i love you" + "n";
- stdin.write(line.getBytes());
- stdin.flush();
- stdin.close();
- // Print out the output
- BufferedReader brCleanUp =
- new BufferedReader(new InputStreamReader(stdout));
- while ((line = brCleanUp.readLine()) != null) {
- System.out.println("[Stdout] " + line);
- }
- brCleanUp.close();
- }
- Exception in thread "main" java.io.IOException: **Stream Closed**
- at java.io.FileOutputStream.writeBytes(Native Method)
- at java.io.FileOutputStream.write(FileOutputStream.java:297)
- at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
- at java.io.BufferedOutputStream.**flush(BufferedOutputStream.java**:140)
- at moses.MOSES.main(MOSES.java:60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement