Is it possible to redirect System.out and System.in for a thread

I would like to run two threads. One should keep writing to System.out and System.in. The other thread output written to System.out and System.in shoudl be captured and written to a file. Is this possible? I don't think so, but perhaps someone know some workaround.rasped
[286 byte] By [raspeda] at [2007-10-2 0:51:55]
# 1
What keeps you from writing to the file right away, without redirecting System.out? A stream is a stream.
CeciNEstPasUnProgrammeura at 2007-7-15 18:11:34 > top of Java-index,Java Essentials,Java Programming...
# 2
hmmm sure it's possible. You can write an outputstream that does different things depending on which thread is running, and then set system.out to a printstream that writes to that outputstream.
jsalonena at 2007-7-15 18:11:34 > top of Java-index,Java Essentials,Java Programming...
# 3
sure can http://javaalmanac.com/egs/java.lang/Redirect.html
Chris@WSUa at 2007-7-15 18:11:34 > top of Java-index,Java Essentials,Java Programming...