Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.act365.net.icmp
Class ICMPReader  view ICMPReader download ICMPReader.java

java.lang.Object
  extended bycom.act365.net.icmp.ICMPReader

public class ICMPReader
extends java.lang.Object

ICMPReader reads ICMPMessage objects from a DatagramPacket.


Field Summary
(package private)  short identifier
           
 
Constructor Summary
ICMPReader(short identifier)
          Creates a reader to read from DatagramPacket objects.
 
Method Summary
 ICMPMessage read(byte[] buffer, int length, int offset, boolean testchecksum)
          read() constructs an ICMP message from a buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

short identifier
Constructor Detail

ICMPReader

public ICMPReader(short identifier)
Creates a reader to read from DatagramPacket objects. The reader will only accept ICMP packets with the specified identifier.

Method Detail

read

public ICMPMessage read(byte[] buffer,
                        int length,
                        int offset,
                        boolean testchecksum)
                 throws java.io.IOException
read() constructs an ICMP message from a buffer. An exception will be thrown if the message is not in the ICMP format or if there is a checksum error but the message will simply be ignored should the identifier does not match.