1、将输出流out作为printstream的输出流,不会自动flush,采用默认字符集。
printstream out = new printstream(outputstream out);
2、创建file对应的fileoutputstream,然后将fileoutputstream作为printstream的输出流。
printstream out = new printstream(file file);
创建filename对应的fileoutputstream,然后将fileoutputstream作为printstream的输出流。
printstream out = new printstream(string filename, string charsetname);
以上就是如何使用java创建printstream对象?的详细内容。