/// <summary> /// Flushes the stream and checks its error state. The internal error state /// is set to <code>true</code> when the underlying output stream throws an /// <code>IOException</code> other than <code>InterruptedIOException</code>, /// and when the <code>setError</code> method is invoked. If an operation /// on the underlying output stream throws an /// <code>InterruptedIOException</code>, then the <code>PrintStream</code> /// converts the exception back into an interrupt by doing: /// <pre> /// Thread.currentThread().interrupt(); /// </pre> /// or the equivalent. /// </summary> /// <returns> <code>true</code> if and only if this stream has encountered an /// <code>IOException</code> other than /// <code>InterruptedIOException</code>, or the /// <code>setError</code> method has been invoked </returns> public virtual bool CheckError() { if (@out != null) { Flush(); } if (@out is java.io.PrintStream) { PrintStream ps = (PrintStream)@out; return(ps.CheckError()); } return(Trouble); }
/// <summary> /// Flushes the stream if it's not closed and checks its error state. /// </summary> /// <returns> <code>true</code> if the print stream has encountered an error, /// either on the underlying output stream or during a format /// conversion. </returns> public virtual bool CheckError() { if (@out != null) { Flush(); } if (@out is java.io.PrintWriter) { PrintWriter pw = (PrintWriter)@out; return(pw.CheckError()); } else if (PsOut != null) { return(PsOut.CheckError()); } return(Trouble); }