Here you can find the source of convertLongToCidr(long unsignedIntCidr)
public static int convertLongToCidr(long unsignedIntCidr)
//package com.java2s; //License from project: Open Source License public class Main { public static int convertLongToCidr(long unsignedIntCidr) { for (int i = 32; i >= 0; i--) { if ((unsignedIntCidr & 0x00000001) == 1) return i; unsignedIntCidr >>>= 1; }//w w w .j ava2 s . c o m return 0; } }