|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectWriter
FilterWriter
EchoWriter
@ThreadSafe @Decorator(value=java.io.Writer.class) public class EchoWriter
A writer that copy all output to an other stream. This writer can be used for performing an exact copy of what is sent to an other writer. For example, it may be used for echoing to the standard output the content sent to a file. This writer is useful for debugging purpose.
| utility/geotk-utility (download) | View source code for this class |
| Field Summary |
|---|
| Fields inherited from class FilterWriter |
|---|
out |
| Fields inherited from class Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
EchoWriter(Writer main)
Creates a writer that will echo to the standard output. |
|
EchoWriter(Writer main,
Writer echo)
Creates a copy writer for the specified stream. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the main stream and the echo stream. |
void |
flush()
Flushes both streams. |
String |
toString()
Returns a string representation if this writer. |
void |
write(char[] cbuf)
Writes an array of characters. |
void |
write(char[] cbuf,
int offset,
int length)
Writes a portion of an array of characters. |
void |
write(int c)
Writes a single character. |
void |
write(String string)
Writes a string. |
void |
write(String string,
int offset,
int length)
Writes a portion of a string. |
| Methods inherited from class Writer |
|---|
append, append, append |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EchoWriter(Writer main)
main - The main stream.
public EchoWriter(Writer main,
Writer echo)
main - The main stream.echo - The echo stream.| Method Detail |
|---|
public void write(int c)
throws IOException
write in class FilterWriterc - The character to write.
IOException - If an I/O error occurs.
public void write(char[] cbuf)
throws IOException
write in class Writercbuf - Buffer of characters to be written.
IOException - If an I/O error occurs.
public void write(char[] cbuf,
int offset,
int length)
throws IOException
write in class FilterWritercbuf - Buffer of characters to be written.offset - Offset from which to start reading characters.length - Number of characters to be written.
IOException - If an I/O error occurs.
public void write(String string)
throws IOException
write in class Writerstring - String to be written.
IOException - If an I/O error occurs.
public void write(String string,
int offset,
int length)
throws IOException
write in class FilterWriterstring - String to be written.offset - Offset from which to start writing characters.length - Number of characters to write.
IOException - If an I/O error occurs.
public void flush()
throws IOException
flush in interface Flushableflush in class FilterWriterIOException - If an I/O error occurs.
public void close()
throws IOException
close in interface Closeableclose in class FilterWriterIOException - If an I/O error occurs.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||