com.act365.net.icmp
Class ICMPReader
java.lang.Object
|
+--com.act365.net.icmp.ICMPReader
- public class ICMPReader
- extends java.lang.Object
ICMPReader reads ICMPMessage objects from a DatagramPacket.
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 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ICMPReader
public ICMPReader(short identifier)
- Creates a reader to read from DatagramPacket objects.
The reader will only accept ICMP packets with the
specified identifier.
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.
- Returns:
- The ICMPMessage contained in the packet or null if the
identifier did not match.