在你setout之前,把System.out赋值给一个PrintStream对象;如:
PrintStream new = new PrintStream(....);
PrintStream old = System.out;
System.setout(new);
......
.....
System.setout(old);//这样就恢复到默认输出状态了.
PrintStream new = new PrintStream(....);
PrintStream old = System.out;
System.setout(new);
......
.....
System.setout(old);//这样就恢复到默认输出状态了.
System.setOut(new PrintStream(new BufferredOutputStream(fdOut, 128), true));