/**
*Title:PrintStreamTest_1(打印流测试)
*Description:向指定文件输入内容,并改变显示的方式(不是在命令提示符的界面输出)
*@Copyright:
*@Company:
*@autor:firefly
*@vertion:1.0
*@time:2012.9.25
*/
import java.io.*;
public class TestPrintStream_1 {
public static void main(String[] args) {
PrintStream ps = null;
try{
FileOutputStream fos = new FileOutputStream("G:\\java学习宝典\\TestPrintStream.dat");
ps = new PrintStream(fos);
}catch(IOException e){
e.printStackTrace();
}
if(ps != null)
{
System.setOut(ps);
}
int ln = 0;
for(char c = 0; c <= 60000; c++){
System.out.print(c + " ");
if(ln++ >= 100){
System.out.println();
ln = 0;
}
}
}
}