NOTE: Coming back to this later as I\'ve been unable to find a working solution. Draining the input streams manually instead of using BufferedReaders doesn
int exitValue = gpgProcess.exitValue();
// it gives process has not exited exception