private void readMessagesFromProcess(final InputStream inputStream, String streamName,
			final TaskMonitor monitor) {
		Runnable runnable = new Runnable() {
			@Override
			public void run() {
				StringBuffer buffer = new StringBuffer();
				try {
					byte[] bytes = new byte[0x1000];
					while (!monitor.isCancelled()) {
						int nRead = inputStream.read(bytes);
						if (nRead == -1) {
							break;
						}
						buffer.append(new String(bytes, 0, nRead));
					}
				}
				catch (Exception e) {
					Msg.error(this, "Exception while reading JAD process inputstream", e);
				}
				String string = buffer.toString().trim();
				if (string.length() > 0) {
					string = string.replace("\n", "\n" + streamName + ": ");
					Msg.info(JadProcessController.this, "\n" + streamName + ": " + string);
				}
			}
		};
		Thread thread = new Thread(runnable, "JAD processes stdout/stderr reader");
		thread.start();
	}
Reads the data from stdin and sterr.
It is important to clear the I/O streams of a native process.
If the stream fills, then the process will block.
Ghidra/Features/FileFormats/src/main/java/ghidra/file/jad/JadProcessController.java