I have a Java-app with an InputStream, which is copying data to an OutputStream. I want to compress the data from the InputStream using FreeArc, before writing it to the OutputStream.
The problem is that there’s no Java-API against FreeArc. I therefore need to pipe it through the command-line exe somehow. I.e. I have to fool FreeArc that it’s reading and writing two files when it’s in fact reading from my InputStream and writing to my OutputStream. On Unix this is quite straightforward but I have to make this work on Windows.
How do you suggest I do that? Is there a way to access Windows’ Named Pipes in Java or can I do it over sockets? Something else? This will be done ~1/sec so the overhead can’t be too high.
If freearc can take input from standard in and send output to standard out, then
ProcessBuildercan be used to invoke the command and theProcessinstance returned will expose the external process’ standard input and output.