public class AbortablePrintWriter
extends java.io.PrintWriter
PrintWriter that adds the ability to abort creation
and an onClose hook
Experimental API - subject to change.
| Constructor and Description |
|---|
AbortablePrintWriter(java.io.PrintWriter pw)
Wrap a
PrintWriter instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort creation of this output.
|
void |
close() |
protected void |
onClose(boolean aborted)
Called exactly once when this
PrintWriter is closed or aborted. |
append, append, append, checkError, clearError, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, writepublic AbortablePrintWriter(java.io.PrintWriter pw)
PrintWriter instance.pw - java.lang.RuntimeException - if there are reflection errors accessing the out
field in pwpublic void abort()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.PrintWriterprotected void onClose(boolean aborted)
PrintWriter is closed or aborted.aborted -