Package org.jnetpcap.packet.format

Examples of org.jnetpcap.packet.format.JFormatter.format()


  public void testXmlIp4RecordRouteOpt() throws IOException {
    JFormatter out = new XmlFormatter(OUT);
   
    JPacket packet = TestUtils.getPcapPacket("tests/test-icmp-recordroute-opt.pcap", 0);

    out.format(packet);
  }

 
  /**
   * Test sub header.
View Full Code Here


  public void testSubHeader() throws IOException {
    JFormatter out = new TextFormatter(OUT);
   
    JPacket packet = TestUtils.getPcapPacket("tests/test-afs.pcap", 0);

    out.format(packet);
  }

}
View Full Code Here

   */
  public String toString() {
    JFormatter out = JPacket.getFormatter();
    out.reset();
    try {
      out.format(this);
    } catch (IOException e) {
      throw new IllegalStateException("Unexpected StringBuilder IO error");
    }
    return out.toString();
  }
View Full Code Here

  public void test1() throws IOException {
    JPacket packet = getPcapPacket(HTTP, 5);

    JFormatter out = new TextFormatter(System.out);

    out.format(packet);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.