01: package vicazh.hyperpool.stream.net.http.html;
02:
03: import java.io.*;
04: import vicazh.hyperpool.Start;
05: import vicazh.hyperpool.stream.Stream;
06:
07: public class AntivirusClamAVStream extends Stream {
08:
09: AntivirusClamAVStream(Connection connection) {
10: super (connection, new ByteArrayOutputStream());
11: }
12:
13: public void write(int b) throws IOException {
14: if (b == 10) {
15: synchronized (connection) {
16: ((AntivirusClamAVConnection) connection).result = ((ByteArrayOutputStream) outputstream)
17: .toString();
18: Start.logger
19: .finer(((AntivirusClamAVConnection) connection).result);
20: connection.notify();
21: }
22: ((ByteArrayOutputStream) outputstream).reset();
23: } else
24: super .write(b);
25: }
26:
27: public void close() throws IOException {
28: super.close();
29: connection.getClient().close();
30: }
31: }
|