OSDN Git Service

Use native code to convert IP addresses to strings.
authorLorenzo Colitti <lorenzo@google.com>
Thu, 17 Sep 2009 22:01:47 +0000 (15:01 -0700)
committerLorenzo Colitti <lorenzo@google.com>
Fri, 18 Sep 2009 20:41:06 +0000 (13:41 -0700)
commitb663ba5604080f14f682b2defed9bea57346d5b5
tree23673244efa4890881d6ecabd56cca8dde7036f2
parenteea407c0e9b0a92aa80891e94125a82fac6aa514
Use native code to convert IP addresses to strings.

- Add a byteArrayToIpString method to the INetworkSystem interface and implement
  it in native code
- Fix the native code so it does better error reporting
- Change InetAddress's getHostAddress, getHostName and getCanonicalHostName
  methods to use it and remove the IPv4-only Java implementations
- Remove Inet6Util.createIPAddrStringFromByteArray
- Fix InetAddress so getByAddress(null) throws UnknownHostException instead of
  NullPointerException for compatibility with the RI.

Change-Id: I26548922e9eed63b295173456183c4ab3ce20718
libcore/luni/src/main/java/java/net/Inet4Address.java
libcore/luni/src/main/java/java/net/Inet6Address.java
libcore/luni/src/main/java/java/net/InetAddress.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/util/Inet6Util.java
libcore/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp