Here you can find the source of remove(InetAddress[] a_, InetAddress b)
static final public InetAddress[] remove(InetAddress[] a_, InetAddress b)
//package com.java2s; //License from project: Apache License import java.net.InetAddress; public class Main { static final public InetAddress[] remove(InetAddress[] a_, InetAddress b) { InetAddress[] a = (InetAddress[]) a_.clone(); for (int i = 0; i < a.length; i++) if (b.equals(a[i])) { a[i] = null;/*w w w . j a va2s .c om*/ break; } return removeNull(a); } public final static InetAddress[] removeNull(InetAddress addrs[]) { int count = 0; for (int i = 0; i < addrs.length; i++) if (addrs[i] != null) count++; InetAddress[] result = new InetAddress[count]; count = 0; for (int i = 0; i < addrs.length; i++) if (addrs[i] != null) result[count++] = addrs[i]; return result; } }