LoggingInputStreampublic 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 int | read()
_recorder.incrementCounter(1);
return super.read();
| public int | read(byte[] b)
int numberOfBytes = super.read(b);
_recorder.incrementCounter(numberOfBytes);
return numberOfBytes;
| public int | read(byte[] b, int off, int len)
int numberOfBytes = super.read(b, off, len);
_recorder.incrementCounter(numberOfBytes);
return numberOfBytes;
|
|