net.sourceforge.jpcap.net
Class IPAddress

java.lang.Object
  |
  +--net.sourceforge.jpcap.net.IPAddress

public class IPAddress
extends java.lang.Object

IP address.

This class doesn't store IP addresses. There's a java class for that, and it is too big and cumbersome for our purposes.

This class contains a utility method for extracting an IP address from a big-endian byte array.


Field Summary
static int WIDTH
          The width in bytes of an IP address.
 
Constructor Summary
IPAddress()
           
 
Method Summary
static java.lang.String extract(int offset, byte[] bytes)
          Extract an IP address from an array of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH

public static final int WIDTH
The width in bytes of an IP address.
Constructor Detail

IPAddress

public IPAddress()
Method Detail

extract

public static java.lang.String extract(int offset,
                                       byte[] bytes)
Extract an IP address from an array of bytes.
Parameters:
offset - the offset of the address data from the start of the packet.
bytes - an array of bytes containing one or more IP addresses.