Code example for EOFException

0
                String addressString = IPUtils.createAddressString(IPUtils.calcLastAddress(net, networkBits));
                if (lastIP.equals(addressString))
                    throw new EOFException("No more IPs available");
            } else { 
                if (lastIP.equals(endAddress))
                    throw new EOFException("No more IPs available");
            } 
 
            lastIP = IPUtils.createAddressString(IPUtils.nextAddress(IPUtils.getByteAddress(lastIP)));
        } 
 
        return lastIP;
    } 
 
    /** 
     * @return network address 
     */ 
    public String getNetworkAddress() {
        return networkAddress;
    }