| DataDisplayAnalyzer.java |
1 /*
2 * @(#) $Id: DataDisplayAnalyzer.java,v 1.3 2003/07/08 08:13:53 pankaj Exp $
3 *
4 * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net).
5 * All rights reserved.
6 *
7 * The license governing the use of this file can be found in the
8 * root directory of the containing software.
9 */
10package org.jstk.ssl;
11
12import java.net.*;
13import java.io.*;
14import org.jstk.JSTKUtil;
15
16public class DataDisplayAnalyzer implements ProtocolAnalyzer {
17 private String label = null;
18 public DataDisplayAnalyzer(String label) {
19 this.label = label;
20 }
21
22 public void analyze(JSTKBuffer buf){
23 System.out.println("[TCP] C " + label + " S (" + buf.getNBytes() + " bytes)");
24 System.out.print(JSTKUtil.readableFromBytes(buf.getByteArray(), 0, buf.getNBytes()));
25 }
26}
27