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

Quick Search    Search Deep

java.net
Class VMInetAddress  view VMInetAddress download VMInetAddress.java

java.lang.Object
  extended byjava.net.VMInetAddress
All Implemented Interfaces:
java.io.Serializable

class VMInetAddress
extends java.lang.Object
implements java.io.Serializable


Constructor Summary
(package private) VMInetAddress()
           
 
Method Summary
static java.lang.String getHostByAddr(byte[] ip)
          This method returns the hostname for a given IP address.
static byte[][] getHostByName(java.lang.String hostname)
          Returns a list of all IP addresses for a given hostname.
static java.lang.String getLocalHostname()
          This method looks up the hostname of the local machine we are on.
static byte[] lookupInaddrAny()
          Returns the value of the special address INADDR_ANY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMInetAddress

VMInetAddress()
Method Detail

getLocalHostname

public static java.lang.String getLocalHostname()
This method looks up the hostname of the local machine we are on. If the actual hostname cannot be determined, then the value "localhost" will be used. This native method wrappers the "gethostname" function.


lookupInaddrAny

public static byte[] lookupInaddrAny()
                              throws UnknownHostException
Returns the value of the special address INADDR_ANY


getHostByAddr

public static java.lang.String getHostByAddr(byte[] ip)
                                      throws UnknownHostException
This method returns the hostname for a given IP address. It will throw an UnknownHostException if the hostname cannot be determined.


getHostByName

public static byte[][] getHostByName(java.lang.String hostname)
                              throws UnknownHostException
Returns a list of all IP addresses for a given hostname. Will throw an UnknownHostException if the hostname cannot be resolved.