InvertedShellWrapper wrapper = new InvertedShellWrapper(shell);
wrapper.setInputStream(in);
wrapper.setOutputStream(out);
wrapper.setErrorStream(err);
wrapper.setExitCallback(new BogusExitCallback());
wrapper.start(new BogusEnvironment());
wrapper.pumpStreams();
// check the streams were flushed before exiting