private static int GetLength(uint[] data) { int ret = data.Length - 1; while (ret >= 0 && data[ret] == 0) ret--; return ret + 1; }