< prev index next >
src/java.base/share/classes/java/net/InetAddress.java
Print this page
*** 954,964 ****
public HostsFileNameService (String hostsFileName) {
this.hostsFile = hostsFileName;
}
! private String addrToString(byte addr[]) {
String stringifiedAddress = null;
if (addr.length == Inet4Address.INADDRSZ) {
stringifiedAddress = Inet4Address.numericToTextFormat(addr);
} else { // treat as an IPV6 jobby
--- 954,964 ----
public HostsFileNameService (String hostsFileName) {
this.hostsFile = hostsFileName;
}
! private String addrToString(byte[] addr) {
String stringifiedAddress = null;
if (addr.length == Inet4Address.INADDRSZ) {
stringifiedAddress = Inet4Address.numericToTextFormat(addr);
} else { // treat as an IPV6 jobby
*** 1032,1042 ****
public InetAddress[] lookupAllHostAddr(String host)
throws UnknownHostException {
String hostEntry;
String addrStr = null;
InetAddress[] res = null;
! byte addr[] = new byte[4];
ArrayList<InetAddress> inetAddresses = null;
// lookup the file and create a list InetAddress for the specfied host
try (Scanner hostsFileScanner = new Scanner(new File(hostsFile), "UTF-8")) {
while (hostsFileScanner.hasNextLine()) {
--- 1032,1042 ----
public InetAddress[] lookupAllHostAddr(String host)
throws UnknownHostException {
String hostEntry;
String addrStr = null;
InetAddress[] res = null;
! byte[] addr = new byte[4];
ArrayList<InetAddress> inetAddresses = null;
// lookup the file and create a list InetAddress for the specfied host
try (Scanner hostsFileScanner = new Scanner(new File(hostsFile), "UTF-8")) {
while (hostsFileScanner.hasNextLine()) {
< prev index next >