I am invoking a function that is printing some string in my console/standard output. I need to capture this string. I cannot modify the function that is doing the printing, nor change runtime behavior through inheritance. I am unable to find any pre-defined methods that will allow me to do this.
Does the JVM store a buffer of printed contents?
Does anyone know of a Java method that will aid me?
System.console().writer().print()
printings will not be redirected withSystem.setOut(myPrintStream);
– Multicolor