Intercepting console output which originated from Tess4J
问题 I am trying to intercept the red Empty page!! message that gets printed to my screen when using Tess4J . I wrote a short interceptor class that overrides print and println and replaced stdout and stderr to check for this string: private static class Interceptor extends PrintStream { public Interceptor(OutputStream out) { super(out, true); } @Override public void print(String s) { if ( !s.contains("Empty page!!") ) super.print(s); } @Override public void println(String s) { if ( !s.contains(