Hello,
I have the following code:
Launches a cpp program.
cpp = runtime.exec(cmds);
And this is the java code
Code:
try
{
cpin =new BufferedInputStream(new DataOutputStream(cpp.getOutputStream()));
cpin.write('a');
cpin.close();
}
catch(IOException err)
{ Const.error(err); }
The problem is that if I call this function twice (the cpp it is initialized only once), oddly my program in C + + does not read the result of write ().I thought that doing a flush () first and then a close () at the very end would be a solution but nothing came of it. I think the getOutputStream() works only once in the program.
Bookmarks