1
10package org.jstk.ssl;
11
12import java.net.*;
13import java.io.*;
14import org.jstk.JSTKUtil;
15
16public class HttpAnalyzer implements ProtocolAnalyzer {
17 private String label = null;
18 public HttpAnalyzer(String label) {
19 this.label = label;
20 }
21
22 public void analyze(JSTKBuffer buf){
23 System.out.println("[HTTP] C " + label + " S (" + buf.getNBytes() + " bytes)");
24 try {
25 ByteArrayInputStream bais = new ByteArrayInputStream(buf.getByteArray(), 0, buf.getNBytes());
26 BufferedReader br = new BufferedReader(new InputStreamReader(bais));
27
28 String line;
29 while ((line = br.readLine()) != null){
30 System.out.println(line);
31 }
32 br.close();
33 } catch (IOException ioe){
34 }
36 }
38}
39