Home | History | Annotate | Download | only in net

Lines Matching refs:ipAddress

134     byte[] ipaddress;
149 InetAddress(int family, byte[] ipaddress, String hostName) {
151 this.ipaddress = ipaddress;
169 return Arrays.equals(this.ipaddress, ((InetAddress) obj).ipaddress);
180 return ipaddress.clone();
375 return Arrays.hashCode(ipaddress);
441 return makeInetAddress(address.ipaddress.clone(), hostname);
744 * Equivalent to {@code getByAddress(null, ipAddress)}. Handy for addresses with
747 public static InetAddress getByAddress(byte[] ipAddress) throws UnknownHostException {
748 return getByAddress(null, ipAddress, 0);
753 * bytes {@code ipAddress} and {@code scopeId}.
765 * @throws UnknownHostException if {@code ipAddress} is null or the wrong length.
767 public static InetAddress getByAddress(String hostName, byte[] ipAddress) throws UnknownHostException {
768 return getByAddress(hostName, ipAddress, 0);
771 private static InetAddress getByAddress(String hostName, byte[] ipAddress, int scopeId) throws UnknownHostException {
772 if (ipAddress == null) {
773 throw new UnknownHostException("ipAddress == null");
775 if (ipAddress.length == 4) {
776 return new Inet4Address(ipAddress.clone(), hostName);
777 } else if (ipAddress.length == 16) {
781 if (isIPv4MappedAddress(ipAddress)) {
782 return new Inet4Address(ipv4MappedToIPv4(ipAddress), hostName);
784 return new Inet6Address(ipAddress.clone(), hostName, scopeId);
787 throw badAddressLength(ipAddress);
795 private static boolean isIPv4MappedAddress(byte[] ipAddress) {
799 if (ipAddress == null || ipAddress.length != 16) {
803 ipAddress[i] != 0) {
807 if (ipAddress[10] != -1 || ipAddress[11] != -1) {
829 if (ipaddress == null) {
832 fields.put("address", Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN));
843 ipaddress = new byte[4];
844 Memory.pokeInt(ipaddress, 0, addr, ByteOrder.BIG_ENDIAN);
854 return new Inet4Address(ipaddress, hostName);