2002-10-05 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java (getByAddress): Fixed documentation. (getByAddress): New method. * java/net/Inet4Address.java: New file. * java/net/URL.java (URL): Documentation added. (getContent): Documentation added. (getContent): New stubbed method. (getQuery): New method. (openConnection): Documentation added. (openStream): Documentation added. (setURLStreamHandlerFactory): Documentation added. * java/net/URI.java: New stub file. * Makefile.am (java_native_source_files): Added java/net/Inet4Address.java, java/net/Inet6Address.java and java/net/URI.java. * Makefile.in: Regenerated. From-SVN: r57841
This commit is contained in:
parent
fec836256e
commit
f5b63cb6d7
7 changed files with 800 additions and 3 deletions
|
@ -230,7 +230,6 @@ public class InetAddress implements Serializable
|
|||
* address is in getAddress()[0].
|
||||
*
|
||||
* @exception UnknownHostException If IP address has illegal length
|
||||
* be found
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
|
@ -243,6 +242,23 @@ public class InetAddress implements Serializable
|
|||
return new InetAddress (addr, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an InetAddress based on the provided host name and IP address.
|
||||
* No name service is checked for the validity of the address.
|
||||
*
|
||||
* @exception UnknownHostException If IP address is of illegal length
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
public static InetAddress getByAddress (String host, byte[] addr)
|
||||
throws UnknownHostException
|
||||
{
|
||||
if (addr.length == 4 || addr.length == 16)
|
||||
return new InetAddress (addr, host);
|
||||
|
||||
throw new UnknownHostException ("IP address has illegal length");
|
||||
}
|
||||
|
||||
/** If host is a valid numeric IP address, return the numeric address.
|
||||
* Otherwise, return null. */
|
||||
private static native byte[] aton (String host);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue