Horje
capture console output java Code Example
capture console output java
// Create a stream to hold the output
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
// IMPORTANT: Save the old System.out!
PrintStream old = System.out;
// Tell Java to use your special stream
System.setOut(ps);
// Print some output: goes to your special stream
System.out.println("Foofoofoo!");
// Put things back
System.out.flush();
System.setOut(old);
// Show what happened
System.out.println("Here: " + baos.toString());




Java

Related
get method jdbc Code Example get method jdbc Code Example
how to declare a variable when using loops Java Code Example how to declare a variable when using loops Java Code Example
long to double in java Code Example long to double in java Code Example
csv file data structure java Code Example csv file data structure java Code Example
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable Code Example Duplicate class android.support.v4.os.ResultReceiver$MyRunnable Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11