FileDocCategorySizeDatePackage
LoggingInputStream.javaAPI DocExample1007Thu Nov 08 00:23:26 GMT 2001com.ora.rmibook.chapter2.sockets

LoggingInputStream

public class LoggingInputStream extends FilterInputStream

Fields Summary
private Recorder
_recorder
Constructors Summary
public LoggingInputStream(InputStream inputStream, String fileName)

        this (inputStream, new Recorder(fileName));
    
public LoggingInputStream(InputStream inputStream, Recorder recorder)

        super (inputStream);
        _recorder = recorder;
    
Methods Summary
public intread()

        _recorder.incrementCounter(1);
        return super.read();
    
public intread(byte[] b)

        int numberOfBytes = super.read(b);

        _recorder.incrementCounter(numberOfBytes);
        return numberOfBytes;
    
public intread(byte[] b, int off, int len)

        int numberOfBytes = super.read(b, off, len);

        _recorder.incrementCounter(numberOfBytes);
        return numberOfBytes;