01: package examples;
02:
03: import java.io.*;
04: import java.util.*;
05: import vicazh.hyperpool.stream.net.http.*;
06:
07: class ExampleServiceClientStream extends ClientStream {
08:
09: ExampleServiceClientStream(Session session,
10: OutputStream outputstream) {
11: super (session, outputstream);
12: }
13:
14: public void header() throws IOException {
15: StringBuffer result = new StringBuffer();
16: result.append("Client HTTP header\r\n\r\n");
17: result.append("method: " + getMethod() + "\r\n");
18: result.append("file: " + getFile() + "\r\n");
19: result.append("version: " + getVersion() + "\r\n");
20: for (Map.Entry<String, String> e : getFields().entrySet())
21: result.append(e.getKey() + ": " + e.getValue() + "\r\n");
22: ((ExampleService) connection.element).print(result.toString());
23: super.header();
24: }
25: }
|