How to read a 32 bit unsigned integer on tcp stream?

As far as I remember 32 bits are equivalent to 4 bytes, so just do packet: 4. From my understanding that should work. I can’t test right now, as I’m not near to a computer.