Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error/Output streams with current java process

I know to use ErrorStream or OutputStream you do the following

Process process = Runtime.getRuntime ().exec ("the command you want to execute");
OutputStream stdin = process.getOutputStream ();
InputStream stderr = process.getErrorStream ();

What if I don't want to start a new process, I want to get the ErrorStream & OutputStream of the current application I am working on. (The current process).

How to get it ?

like image 837
Mariam Avatar asked Dec 21 '22 03:12

Mariam


1 Answers

You use System.out and System.err.

like image 152
OpenSauce Avatar answered Dec 24 '22 02:12

OpenSauce