public class PrintOutput extends OutputStream
Modifier | Constructor and Description |
---|---|
protected |
PrintOutput(OutputStream os)
Constructor, given an output stream.
|
|
PrintOutput(String fn)
Constructor, given a filename.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
encoding()
Returns the encoding.
|
boolean |
finished()
Checks if stream can output more characters; can be overwritten to
interrupt streaming at some point.
|
void |
flush() |
static PrintOutput |
get(OutputStream out)
Returns a new instance for the given output stream.
|
void |
print(byte[] token)
Prints a token to the output stream.
|
void |
print(int cp)
Prints a single codepoint.
|
void |
print(String string)
Prints a string to the output stream.
|
void |
println(byte[] token)
Prints a token to the output stream, followed by a system-specific newline.
|
void |
println(String string)
Prints a string and newline to the output stream.
|
void |
setLimit(int limit)
Sets the maximum number of bytes to be written.
|
long |
size()
Returns the number of written bytes.
|
void |
write(int b) |
write, write
public PrintOutput(String fn) throws IOException
fn
- filenameIOException
- I/O exceptionprotected PrintOutput(OutputStream os)
os
- output stream referencepublic static PrintOutput get(OutputStream out)
out
- output stream referencepublic final void setLimit(int limit)
limit
- maximumpublic void write(int b) throws IOException
write
in class OutputStream
IOException
public void print(int cp) throws IOException
cp
- codepoint to be printedIOException
- I/O exceptionpublic void print(byte[] token) throws IOException
token
- token to be writtenIOException
- I/O exceptionpublic void print(String string) throws IOException
string
- string to be writtenIOException
- I/O exceptionpublic final void println(String string) throws IOException
string
- string to be writtenIOException
- I/O exceptionpublic final void println(byte[] token) throws IOException
token
- token to be writtenIOException
- I/O exceptionpublic final long size()
public final void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public final void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public final boolean finished()
public String encoding()
Copyright © 2005–2015 BaseX Team. All rights reserved.