Java InetAddress removeNull(InetAddress addrs[])

Here you can find the source of removeNull(InetAddress addrs[])

Description

remove Null

License

Apache License

Declaration

public final static InetAddress[] removeNull(InetAddress addrs[]) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.InetAddress;

public class Main {
    public final static InetAddress[] removeNull(InetAddress addrs[]) {
        int count = 0;
        for (int i = 0; i < addrs.length; i++)
            if (addrs[i] != null)
                count++;//from   w  ww.j  av a 2s. c  o m
        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;
    }
}

Related

  1. normalizeHostAddress(final InetAddress localHost)
  2. parseInetAddressFromString(String input)
  3. readInetAddress(final DataInput in, final boolean fixedLength)
  4. readInetAddress(final String stringInetAddress)
  5. remove(InetAddress[] a_, InetAddress b)
  6. serialize(InetAddress endpoint, DataOutput out)
  7. sortKey(InetAddress address, boolean prefer_v6)
  8. toStringWithNoHostname(InetAddress address)
  9. writeInetAddress(final InetAddress inetAddress, final DataOutput out, final boolean fixedLength)