List<T> readArray<T>(T Function() func, {int? arrayLen}) { var len = arrayLen; if (len == null || len < 0) { len = readUint32(); } return List.generate(len, (_) => func()); }