|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
edu.upc.dama.dex.core.TextStream.TextWriter
public static class TextStream.TextWriter
Writer implementation for TextStream.
This way we can use TextStream as a common Java Writer:
long oid = ... // object OID long text = ... // TEXT attribute id TextStream tstrm = new TextStream(); Value v = new Value(tstrm); dbg.setAttribute(oid, text, v); BufferedWriter bw = new BufferedWriter(new TextWriter(tstrm)); while (...) bw.write(...); bw.close(); // it already closes underlaying Writer and TextStream
| Field Summary |
|---|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
TextStream.TextWriter(TextStream strm)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
Close the stream, flushing it first. |
void |
flush()
Flush the stream. |
void |
write(char[] chars,
int i,
int i1)
Write a portion of an array of characters. |
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextStream.TextWriter(TextStream strm)
strm - Underlaying writer TextStream.
java.lang.IllegalArgumentException - If the given TextStream is not
a writer stream.| Method Detail |
|---|
public void write(char[] chars,
int i,
int i1)
throws java.io.IOException
write in class java.io.Writerchars - Array of charactersi - Offset from which to start writing charactersi1 - Number of characters to write
java.io.IOException
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.Writerjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||