|
intarsys runtime library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
de.intarsys.tools.stream.LogInputStream
public class LogInputStream
An InputStream
that logs any char read.
This stream is piped in the reading process, any characters read are written
to an associated OutputStream
object.
Client -> LogInputStream -> InputStream -> Source | v OutputStream
Constructor Summary | |
---|---|
LogInputStream(InputStream newin,
OutputStream newlog)
SplitStream - Konstruktorkommentar. |
Method Summary | |
---|---|
void |
close()
|
OutputStream |
getLog()
|
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this input stream into
an array of bytes. |
void |
setLog(OutputStream newLog)
|
Methods inherited from class java.io.FilterInputStream |
---|
available, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogInputStream(InputStream newin, OutputStream newlog)
newin
- newlog
- Method Detail |
---|
public void close() throws IOException
close
in interface Closeable
close
in class FilterInputStream
IOException
public OutputStream getLog()
public int read() throws IOException
int
in the range 0
to
255
. If no byte is available because the end of the
stream has been reached, the value -1
is returned. This
method blocks until input data is available, the end of the stream is
detected, or an exception is thrown.
A subclass must provide an implementation of this method.
read
in class FilterInputStream
-1
if the end of the
stream is reached.
IOException
- if an I/O error occurs.public int read(byte[] b, int off, int len) throws IOException
len
bytes of data from this input stream into
an array of bytes. This method blocks until some input is available.
This method simply performs in.read(b, off, len)
and
returns the result.
read
in class FilterInputStream
b
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.
-1
if there is no more data because the end of the
stream has been reached.
IOException
- if an I/O error occurs.FilterInputStream.in
public void setLog(OutputStream newLog)
|
intarsys runtime library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |