Here you can find the source of isAny(InetAddress ip)
Parameter | Description |
---|---|
ip | the IP address to test |
public static boolean isAny(InetAddress ip)
//package com.java2s; /*//w ww.j a v a2 s. co m * Copyright (c) 2013-2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ import java.net.InetAddress; public class Main { /** * Returns true if the passed InetAddress contains all zero * * @param ip the IP address to test * @return true if the address is all zero */ public static boolean isAny(InetAddress ip) { for (byte b : ip.getAddress()) { if (b != 0) { return false; } } return true; } }