docs: public static int runLocalCommand(
              final String[] command,
              final Map<String, String> envMap,
              final File workingdir,
              final OutputStream outputStream,
              final OutputStream errorStream
      )
              throws IOException, InterruptedException {
          final String[] envarr = createEnvironmentArray(envMap);
  
          final Runtime runtime = Runtime.getRuntime();
          final Process exec = runtime.exec(command, envarr, workingdir);
          exec.getOutputStream().close();
          final Streams.StreamCopyThread errthread = Streams.copyStreamThread(exec.getErrorStream(), errorStream);
          final Streams.StreamCopyThread outthread = Streams.copyStreamThread(exec.getInputStream(), outputStream);
          errthread.start();
          outthread.start();
          final int result = exec.waitFor();
  
          outputStream.flush();
          errorStream.flush();
          errthread.join();
          outthread.join();
          exec.getInputStream().close();
          exec.getErrorStream().close();
          if (null != outthread.getException()) {
              throw outthread.getException();
          }
          if (null != errthread.getException()) {
              throw errthread.getException();
          }
          return result;
      }