public class ThrowingPrintWriter extends OutputStreamWriter
PrintWriter with methods that throw IOException. PrintWriter explicitly does not throw, and that can catch people
off guard.
Only the methods that were in use in Buck at the time this class was written have been
implemented (including primitive overloads to prevent accidental inefficiencies later). Feel free
to add more methods, but please don't go beyond what PrintWriter itself has.
| Constructor and Description |
|---|
ThrowingPrintWriter(OutputStream out) |
ThrowingPrintWriter(OutputStream out,
Charset cs) |
| Modifier and Type | Method and Description |
|---|---|
ThrowingPrintWriter |
format(String format,
Object... args) |
ThrowingPrintWriter |
printf(String format,
Object... args) |
void |
println() |
void |
println(boolean b) |
void |
println(char c) |
void |
println(char[] x) |
void |
println(double d) |
void |
println(float f) |
void |
println(int i) |
void |
println(long l) |
void |
println(Object o) |
void |
println(String str) |
close, flush, getEncoding, write, write, writepublic ThrowingPrintWriter(OutputStream out)
public ThrowingPrintWriter(OutputStream out, Charset cs)
public ThrowingPrintWriter printf(String format, Object... args) throws IOException
IOExceptionpublic ThrowingPrintWriter format(String format, Object... args) throws IOException
IOExceptionpublic void println(boolean b)
throws IOException
IOExceptionpublic void println(char c)
throws IOException
IOExceptionpublic void println(int i)
throws IOException
IOExceptionpublic void println(long l)
throws IOException
IOExceptionpublic void println(float f)
throws IOException
IOExceptionpublic void println(double d)
throws IOException
IOExceptionpublic void println(char[] x)
throws IOException
IOExceptionpublic void println(Object o) throws IOException
IOExceptionpublic void println(String str) throws IOException
IOExceptionpublic void println()
throws IOException
IOException