intarsys runtime library

de.intarsys.tools.stream
Class LogInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by de.intarsys.tools.stream.LogInputStream
All Implemented Interfaces:
Closeable

public class LogInputStream
extends FilterInputStream

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)
           
 
Method Summary
 void close()
           
 OutputStream getLog()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 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

LogInputStream

public LogInputStream(InputStream newin,
                      OutputStream newlog)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException

getLog

public OutputStream getLog()

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

setLog

public void setLog(OutputStream newLog)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.