public static String toFullBinaryString(long l) {
        StringBuilder s = new StringBuilder(64);
        for (int i=0; i<Long.numberOfLeadingZeros(l); i++) {
            s.append('0');
        }
        if (l == 0) {
            s.deleteCharAt(0);
        }
        s.append(Long.toBinaryString(l));
        return s.toString();
    }
Debugging utility that returns a long value as binary string
including the leading zeroes.
vespajlib/src/main/java/com/yahoo/geo/ZCurve.java