You can use something like the example TeeOutputStreamdescribed here Writing your own Java I / O stream classes
Basically, you create a TeeOutputStream, give it your stream and the current System.out then use System.setOut with the new stream.
Everything written in System.out will be written to the original System.out, as well as your stream, so you can do whatever you want with it.
Edit:
Oracle , TeeOutputStream Apache Commons, - .