ch.elca.el4j.util.socketstatistics
Class InputStreamLogger

java.lang.Object
  extended by java.io.InputStream
      extended by ch.elca.el4j.util.socketstatistics.InputStreamLogger
All Implemented Interfaces:
Closeable

public class InputStreamLogger
extends InputStream

Implementation of InputStream with modification for logging.

Author:
Jonas Hauenstein (JHN)
File-location:
InputStreamLogger
Last check-in date:
2009-09-25 16:38:41 +0200 (Fr, 25. Sep 2009) by jonasha for revision 3929

Constructor Summary
InputStreamLogger(InputStream is, ConnectionStatistics cs)
          Constructor.
 
Method Summary
 int read()
          Modified version of read which also logs traffic to assigned ConnectionStatistics.
 int read(byte[] b, int off, int len)
          Modified version of read which also logs traffic to assigned ConnectionStatistics.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamLogger

public InputStreamLogger(InputStream is,
                         ConnectionStatistics cs)
Constructor.

Parameters:
is - original InputStream used for reading
cs - ConnectionStatistics used for logging
Method Detail

read

public int read()
         throws IOException
Modified version of read which also logs traffic to assigned ConnectionStatistics.

Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Modified version of read which also logs traffic to assigned ConnectionStatistics.

Overrides:
read in class InputStream
Throws:
IOException


Copyright © 2005-2011 ELCA. All Rights Reserved.