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, write
public ThrowingPrintWriter(OutputStream out)
public ThrowingPrintWriter(OutputStream out, Charset cs)
public ThrowingPrintWriter printf(String format, Object... args) throws IOException
IOException
public ThrowingPrintWriter format(String format, Object... args) throws IOException
IOException
public void println(boolean b) throws IOException
IOException
public void println(char c) throws IOException
IOException
public void println(int i) throws IOException
IOException
public void println(long l) throws IOException
IOException
public void println(float f) throws IOException
IOException
public void println(double d) throws IOException
IOException
public void println(char[] x) throws IOException
IOException
public void println(Object o) throws IOException
IOException
public void println(String str) throws IOException
IOException
public void println() throws IOException
IOException