FileDocCategorySizeDatePackage
LoggingInputStream.javaAPI DocExample999Thu Nov 08 00:22:32 GMT 2001com.ora.rmibook.chapter1

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;