|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object CTL.Types.IPaddr
public class IPaddr
IP address storage and serialization for IPv4 and IPv6
Field Summary | |
---|---|
private short[] |
IP
8 x 16 Bit = 128 Bit, which is the length of an IPv6 address |
Constructor Summary | |
---|---|
IPaddr()
Create an IPaddr for localhost |
|
IPaddr(java.net.InetAddress in)
Create an IPaddr from the Java InetAddress type |
|
IPaddr(long ip)
Create an IPaddr from an 'unsigned int32' |
|
IPaddr(java.lang.String host)
Create an IPaddr from a hostname |
|
IPaddr(java.lang.String str,
int i)
Create an IPaddr from a hexadecimal string |
Method Summary | |
---|---|
boolean |
equals(java.net.InetAddress ip)
Check if two InetAddresses are equal |
boolean |
equals(IPaddr ip)
Check if two IPaddrs are equal |
static short[] |
getShortArray(java.net.InetAddress ip)
Convert an InetAddress to a short array |
long |
getUint32()
Convert this to an integer |
static long |
getUint32(java.net.InetAddress ip)
Convert ip to an integer |
short[] |
rawIP()
Retrieve the raw short array |
void |
read(SerialIn in)
Serial read function |
static java.net.InetAddress |
setShortArray(short[] ip)
Convert a short array to InetAddress |
static java.net.InetAddress |
setUint32(long ip)
Convert an integer to InetAddress |
java.net.InetAddress |
toInetAddress()
Retrieve an InetAddress representation of this object |
java.lang.String |
toString()
Retrieve a string representation of this object |
void |
write(SerialOut out)
Serial write function |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private short[] IP
Constructor Detail |
---|
public IPaddr(java.net.InetAddress in)
in
- InetAddresspublic IPaddr(long ip) throws java.net.UnknownHostException
ip
- IP address
java.net.UnknownHostException
public IPaddr(java.lang.String str, int i)
str
- Hexadecimal number in a stringi
- Dummy parameterpublic IPaddr(java.lang.String host) throws java.net.UnknownHostException
host
- Hostname
java.net.UnknownHostException
public IPaddr()
Method Detail |
---|
public short[] rawIP()
public void read(SerialIn in) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
read
in interface Writable
in
- Input stream
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public void write(SerialOut out) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
write
in interface Writable
out
- Output stream
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public boolean equals(IPaddr ip)
ip
- IPaddr to compare to
public boolean equals(java.net.InetAddress ip)
ip
- InetAddress to compare to
public long getUint32() throws java.net.UnknownHostException
java.net.UnknownHostException
public static long getUint32(java.net.InetAddress ip)
ip
- InetAddress to convert
public static java.net.InetAddress setUint32(long ip) throws java.net.UnknownHostException
ip
- Integer
java.net.UnknownHostException
public java.lang.String toString()
toString
in class java.lang.Object
public java.net.InetAddress toInetAddress() throws java.net.UnknownHostException
java.net.UnknownHostException
public static java.net.InetAddress setShortArray(short[] ip) throws java.net.UnknownHostException
ip
- Short Array
java.net.UnknownHostException
public static short[] getShortArray(java.net.InetAddress ip)
ip
- InetAddress
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |