I'm trying to use sshj to implement something like cat foo.tar.gz | ssh user@remote tar xzf -, and I used the Command.getOutputStream() to feed these bytes from a local file named foo.tar.gz, but when all bytes is fed, I can't find a way to shutdown the process gracefully.
Invoking the close() method on the stream won't work.