Java Code Examples for org.apache.sanselan.util.IOUtils

The following examples show how to use org.apache.sanselan.util.IOUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public String readVersion() {
  // check file version
  try {
    Process process = new ProcessBuilder(thriftCmd, "--version").start();
    process.waitFor();

    byte[] stdOut;
    InputStream stdOutIS = process.getInputStream();
    try {
      stdOut = IOUtils.getInputStreamBytes(stdOutIS);
      if (stdOut == null || stdOut.length == 0) {
        return null;
      }
    }
    finally {
      stdOutIS.close();
    }

    return new String(stdOut);
  }
  catch (Exception e1) {
    // Ignore
  }

  return null;
}