Java Stream Close closeProcess(Process process)

Here you can find the source of closeProcess(Process process)

Description

close Process

License

LGPL

Declaration

private static void closeProcess(Process process) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.IOException;

public class Main {
    private static void closeProcess(Process process) {
        try {//from  w w  w .  j  av  a 2 s  . com
            process.getInputStream().close();
            process.getOutputStream().close();
            process.getErrorStream().close();
        } catch (IOException e) {
        }

        process.destroy();
        try {
            process.waitFor();
        } catch (InterruptedException e) {
        }

        process = null;
    }
}

Related

  1. closeOutputStream(OutputStream out, boolean flush)
  2. closeOutputStream(OutputStream outputStream)
  3. closePermanentOutputWriter()
  4. closePort()
  5. closePrintWriter(PrintWriter fileOutputStream)
  6. closeProcessStreams(Process p)
  7. closeProofWriter(Writer out)
  8. closeProtectedStream(final OutputStream outputStream)
  9. closeQietly(ZipFile zipFile)