private static String readData()

in src/main/java/org/jutils/jhardware/util/HardwareInfoUtils.java [81:107]


  private static String readData(Process process) {
    StringBuilder commandOutput = new StringBuilder();
    BufferedReader processOutput = null;

    try {
      processOutput = new BufferedReader(new InputStreamReader(process.getInputStream()));

      String line;
      while ((line = processOutput.readLine()) != null) {
        if (!line.isEmpty()) {
          commandOutput.append(line).append(CRLF);
        }
      }
    } catch (IOException ex) {
      Logger.getLogger(HardwareInfoUtils.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
      try {
        if (processOutput != null) {
          processOutput.close();
        }
      } catch (IOException ioe) {
        Logger.getLogger(HardwareInfoUtils.class.getName()).log(Level.SEVERE, null, ioe);
      }
    }

    return commandOutput.toString();
  }