|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.basex.io.out.PrintOutput
public class PrintOutput
This class is a stream-wrapper for textual data. Note that the internal byte representation (usually UTF8) will be directly output without further character conversion.
Constructor Summary | |
---|---|
PrintOutput(java.lang.String fn)
Constructor, given a filename. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.io.OutputStream |
---|
write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintOutput(java.lang.String fn) throws java.io.IOException
fn
- filename
java.io.IOException
- I/O exceptionMethod Detail |
---|
public static PrintOutput get(java.io.OutputStream out)
out
- output stream reference
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void utf8(int ch) throws java.io.IOException
ch
- character to be printed
java.io.IOException
- I/O exceptionpublic final void writeString(java.lang.String str) throws java.io.IOException
str
- string to be written
java.io.IOException
- I/O exceptionpublic final void print(java.lang.String str) throws java.io.IOException
str
- string to be written
java.io.IOException
- I/O exceptionpublic final void println(java.lang.String str) throws java.io.IOException
str
- string to be written
java.io.IOException
- I/O exceptionpublic final void print(byte[] token) throws java.io.IOException
token
- token to be written
java.io.IOException
- I/O exceptionpublic final void println(byte[] token) throws java.io.IOException
token
- token to be written
java.io.IOException
- I/O exceptionpublic final long size()
public final void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public final void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public boolean finished()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |