Get rid of manual int->ipv4 string generation

bug:2542681
Change-Id: I67919d7b5dc8d72eeb2dfb9e3906210b1951d4fb
This commit is contained in:
Robert Greenwalt
2011-01-26 13:57:24 -08:00
parent 7baf8a8f08
commit 3ec1eeea3a

View File

@@ -18,6 +18,7 @@ package android.net;
import android.os.Parcelable; import android.os.Parcelable;
import android.os.Parcel; import android.os.Parcel;
import java.net.InetAddress;
/** /**
* A simple object for retrieving the results of a DHCP request. * A simple object for retrieving the results of a DHCP request.
@@ -65,10 +66,7 @@ public class DhcpInfo implements Parcelable {
} }
private static void putAddress(StringBuffer buf, int addr) { private static void putAddress(StringBuffer buf, int addr) {
buf.append(addr & 0xff).append('.'). buf.append(NetworkUtils.intToInetAddress(addr).getHostAddress());
append((addr >>>= 8) & 0xff).append('.').
append((addr >>>= 8) & 0xff).append('.').
append((addr >>>= 8) & 0xff);
} }
/** Implement the Parcelable interface {@hide} */ /** Implement the Parcelable interface {@hide} */