Yes, ReadUInt32 and WriteUInt32 on both BinaryStream and MemoryBlock make sense. I’ve logged Add unsigned 32-bit binary reads and writes alongside the existing Integer32 and UInteger32 feature. Reads will return UInteger32, and both methods will respect the existing LittleEndian setting.
The existing 64-bit Integer can already represent the full range of MySQL’s INT UNSIGNED, and reading those values is supported. I’ll also check database reads and parameter binding with the new types.
For conversions, ordinary literals such as 0 will work naturally, and widening either 32-bit type to Integer will be automatic because it preserves the value.
I’ll keep conversion from an Integer variable to either 32-bit type explicit, though. LastIndex returns a 64-bit Integer, so your example will still need the cast if you specifically want an Integer32 counter. That conversion will be range checked, raising an error if the value doesn’t fit.
For normal collection traversal, I’d continue to use For i As Integer = 0 To someCollection.LastIndex. The new types are there for calculations that specifically need 32-bit behaviour; Integer remains the general-purpose choice.