public class PrintOutput
extends java.io.OutputStream
| Constructor and Description |
|---|
PrintOutput(java.lang.String fn)
Constructor, given a filename.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
finished()
Checks if stream can output more characters; can be overwritten to
interrupt streaming at some point.
|
void |
flush() |
static PrintOutput |
get(java.io.OutputStream out)
Returns a new instance for the given output stream.
|
void |
print(byte[] token)
Prints a token to the output stream.
|
void |
print(java.lang.String str)
Prints a string to the output stream.
|
void |
println(byte[] token)
Prints a token to the output stream.
|
void |
println(java.lang.String str)
Prints a string and newline to the output stream.
|
long |
size()
Returns the number of written bytes.
|
void |
utf8(int ch)
Writes a character as UTF8.
|
void |
write(int b) |
void |
writeString(java.lang.String str)
Writes a string to the output stream, suffixed by a 0 byte.
|
public PrintOutput(java.lang.String fn)
throws java.io.IOException
fn - filenamejava.io.IOException - I/O exceptionpublic static PrintOutput get(java.io.OutputStream out)
out - output stream referencepublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void utf8(int ch)
throws java.io.IOException
ch - character to be printedjava.io.IOException - I/O exceptionpublic final void writeString(java.lang.String str)
throws java.io.IOException
str - string to be writtenjava.io.IOException - I/O exceptionpublic final void print(java.lang.String str)
throws java.io.IOException
str - string to be writtenjava.io.IOException - I/O exceptionpublic final void println(java.lang.String str)
throws java.io.IOException
str - string to be writtenjava.io.IOException - I/O exceptionpublic final void print(byte[] token)
throws java.io.IOException
token - token to be writtenjava.io.IOException - I/O exceptionpublic final void println(byte[] token)
throws java.io.IOException
token - token to be writtenjava.io.IOException - I/O exceptionpublic final long size()
public final void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic final void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic boolean finished()