|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
things.thinger.io.EchoInputStream
public class EchoInputStream
An echoing input stream.
It is a good idea to flush() this before letting anything else use the echoStream. I did a bunch of flushed inline, but it really slowed things down.
Calling close will do nothing. It's up to the user to decide the fate of the streams.
EPG - New - 20Feb05| Constructor Summary | |
|---|---|
EchoInputStream(java.io.InputStream source,
java.io.OutputStream echoStream)
Constructor. |
|
| Method Summary | |
|---|---|
int |
available()
Returns the number of characters available for read without blocking. |
void |
close()
Close. |
void |
mark(int readlimit)
Mark does nothing. |
boolean |
markSupported()
Mark does nothing so this will always return false. |
int |
read()
Read a single character. |
int |
read(byte[] b)
Reads into an array. |
int |
read(byte[] b,
int off,
int len)
Reads into an array from an offset. |
void |
reset()
Reset is not supported and will always throw and IOException. |
long |
skip(long n)
Skip is not supported and will always throw an IOException. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EchoInputStream(java.io.InputStream source,
java.io.OutputStream echoStream)
throws java.lang.Exception
source - The input stream.echoStream - Where to echo everything.
java.lang.Exception| Method Detail |
|---|
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamb - the destination array.
java.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamb - the destination array.off - the offset in the array.len - the maximum number to read.
java.io.IOException
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class java.io.InputStream
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||