com.jkristian.io
Class CharCopier
java.lang.Object
com.jkristian.io.CharCopier
- All Implemented Interfaces:
- java.lang.Runnable
public class CharCopier
- extends java.lang.Object
- implements java.lang.Runnable
Copies everything from an Reader to a Writer or StringBuffer. A thread can
conveniently run an instance of this class.
Field Summary |
protected java.io.Reader |
in
|
protected java.io.Writer |
out
|
Constructor Summary |
CharCopier(java.io.Reader in,
java.io.Writer out)
|
Method Summary |
static void |
copyAll(java.io.Reader in,
java.lang.StringBuffer out)
|
static void |
copyAll(java.io.Reader in,
java.io.Writer out)
|
static java.lang.StringBuffer |
readAll(java.io.Reader in)
|
void |
run()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected java.io.Reader in
out
protected java.io.Writer out
CharCopier
public CharCopier(java.io.Reader in,
java.io.Writer out)
copyAll
public static void copyAll(java.io.Reader in,
java.io.Writer out)
throws java.io.IOException
- Throws:
java.io.IOException
copyAll
public static void copyAll(java.io.Reader in,
java.lang.StringBuffer out)
throws java.io.IOException
- Throws:
java.io.IOException
readAll
public static java.lang.StringBuffer readAll(java.io.Reader in)
throws java.io.IOException
- Throws:
java.io.IOException
run
public void run()
- Specified by:
run
in interface java.lang.Runnable