i wanted to read the output-stream of a c-Application in my Java program. iremoted (available here: http://osxbook.com/software/iremoted/download/iremoted.c) is a C-App
stdout is buffered and it's not automatically flushed if you are not writing to screen. Add:
stdout
fflush(stdout);
after:
printf("%#lx %s\n", (UInt32)event.elementCookie, (event.value == 0) ? "depressed" : "pressed");