|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
soapical.util.MultiReader
A decorator which allows you to reuse a Reader. This copies the contents of the Reader to an internal buffer. Before you re-use the reader, you will have to call the reopen function.
Constructor Summary | |
MultiReader(java.io.Reader reader)
|
Method Summary | |
void |
close()
|
java.io.Reader |
getCopy()
Return a copy of the Reader. |
java.lang.String |
getCopyAsString()
Return a copy of the Reader's contents as a String. |
boolean |
isClosed()
|
int |
read(char[] cbuf,
int off,
int len)
|
void |
reopen()
Allows this MultiReader to be reused. |
static java.lang.String |
toString(java.io.Reader reader)
|
Methods inherited from class java.io.Reader |
mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MultiReader(java.io.Reader reader)
Method Detail |
public static java.lang.String toString(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public boolean isClosed()
public void reopen() throws java.io.IOException
Forcing people to use this function makes MultiReader less
convenient but more predictable to use. Otherwise, it would
silently loop back to the beginning, and instead of getting
a proper IOException
, people would get the
beginning of the stream again.
java.io.IOException
- if you call this before closing the readerpublic java.io.Reader getCopy() throws java.io.IOException
java.io.IOException
getCopyAsString()
public java.lang.String getCopyAsString() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |