Java.io.PrintStream.clearError() 方法 Java.io.PrintStream.checkError() 方法 Java.io.PrintStream.close() 方法 Java.io.PrintStream.clearError() 方法 package com.codingdict; import java.io.*; public class PrintStreamDemo extends PrintStream { public PrintStreamDemo(OutputStream out) { super(out); } public static void main(String[] args) { byte c[] = {70, 71, 72, 73, 74, 75, 76}; // create printstream object PrintStreamDemo ps = new PrintStreamDemo(System.out); // write bytes 1-3 ps.write(c, 1, 3); // flush the stream ps.flush(); // clear the errors of this stream, if there are any ps.clearError(); } } Java.io.PrintStream.checkError() 方法 Java.io.PrintStream.close() 方法