Executing an EXE from Java and getting input and output from EXE

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

class JavaExecutable {
    public static void main(String[] args)
    {	
    	Process process = null;
	try {
		process = new ProcessBuilder("D:\\executable.exe").start();
	} catch (IOException e) {
		e.printStackTrace();
	}

    	InputStream processInputStream = process.getInputStream();
    	OutputStream processOutputStream = process.getOutputStream();
    	
    	//To write data into the external program, 
    	//you can instantiate a BufferedWriter with the processOutputSream:
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(processOutputStream));
    	
    	//To read data from the external program, 
    	//you can instantiate a BufferedReader with the processInputStream
    	BufferedReader reader = new BufferedReader(new InputStreamReader(processInputStream));
    }
}