01: package vicazh.hyperpool.stream;
02:
03: import java.io.*;
04:
05: /**
06: * This class is the null stream
07: *
08: * @author Victor Zhigunov
09: * @version 0.4.0
10: */
11: public class NullStream extends OutputStream {
12:
13: public NullStream() {
14: }
15:
16: /**
17: * The linked output stream
18: */
19: public OutputStream outputstream;
20:
21: /**
22: * @param outputstream
23: * linked output stream
24: */
25: public NullStream(OutputStream outputstream) {
26: this .outputstream = outputstream;
27: }
28:
29: public void write(int b) throws IOException {
30: }
31:
32: public void flush() throws IOException {
33: if (outputstream != null)
34: outputstream.flush();
35: }
36:
37: public void close() throws IOException {
38: if (outputstream == null)
39: return;
40: outputstream.close();
41: outputstream = null;
42: }
43: }
|