public static int NumSize(ulong num) { int bytes = 1; while (((num + 1) >> (bytes * 7)) != 0) bytes++; return bytes; }