01: package Shared.Logging.Internal;
02:
03: import java.io.OutputStream;
04: import java.io.IOException;
05:
06: public class FileLoggerStream extends OutputStream {
07:
08: private OutputStream out;
09: private long written;
10:
11: public FileLoggerStream(OutputStream out, long written) {
12: this .out = out;
13: this .written = written;
14: }
15:
16: public long getWritten() {
17: return this .written;
18: }
19:
20: public void write(int b) throws IOException {
21: out.write(b);
22: written++;
23: }
24:
25: public void write(byte buff[]) throws IOException {
26: out.write(buff);
27: written += (long) buff.length;
28: }
29:
30: public void write(byte buff[], int off, int len) throws IOException {
31: out.write(buff, off, len);
32: written += (long) len;
33: }
34:
35: public void flush() throws IOException {
36: out.flush();
37: }
38:
39: public void close() throws IOException {
40: out.close();
41: }
42:
43: } // FileLoggerStream
|