01: package org.openi.test;
02:
03: import java.io.IOException;
04: import java.io.OutputStream;
05:
06: /**
07: *
08: * test output stream class that does not buffer anything,
09: * but traps byte length of output stream
10: *
11: */
12: public class NullOutputStream extends OutputStream {
13: private long size = 0;
14:
15: public NullOutputStream() {
16: }
17:
18: public void write(int b) throws IOException {
19: //bogus
20: size++;
21: }
22:
23: public long length() {
24: return this.size;
25: }
26: }
|