The most common use case of writing larger-than-32-bit integers to the net stream or a file is probably for SteamID64s.
Currently, it's wasteful to write a SteamID64 to one of these streams as it must be written as a string. That means your average SteamID64 is going to take up 136 bits (17 bytes).
Whilst 17 bytes is nothing to panic about, it would be trivial to implement the following methods:
[ ] net.ReadSteamID64() -> string
[ ] net.WriteSteamID64(steamid64: string)
[ ] File:ReadSteamID64() -> string
[ ] File:WriteSteamID64(steamid64: string)
These methods would cover 99% of use cases for writing larger-than-32-bit integers to the respective streams in Garry's Mod and would help keep the size of SteamID64-heavy net messages and files down.
Additionally, it would make some net message code easier to write. String SteamID64s are actually technically not always 17 bytes, so keeping track of the remaining length of the buffer would be made easier, for example. (It should be acknowledged however that net.BytesLeft() does exist)
* For anyone reading that needs to more efficiently send SteamID64s you can use a big hack I wrote here in the mean time
Details
The most common use case of writing larger-than-32-bit integers to the net stream or a file is probably for SteamID64s.
Currently, it's wasteful to write a SteamID64 to one of these streams as it must be written as a string. That means your average SteamID64 is going to take up 136 bits (17 bytes).
Whilst 17 bytes is nothing to panic about, it would be trivial to implement the following methods:
net.ReadSteamID64() -> string
net.WriteSteamID64(steamid64: string)
File:ReadSteamID64() -> string
File:WriteSteamID64(steamid64: string)
These methods would cover 99% of use cases for writing larger-than-32-bit integers to the respective streams in Garry's Mod and would help keep the size of SteamID64-heavy net messages and files down.
Additionally, it would make some net message code easier to write. String SteamID64s are actually technically not always 17 bytes, so keeping track of the remaining length of the buffer would be made easier, for example. (It should be acknowledged however that
net.BytesLeft()
does exist)* For anyone reading that needs to more efficiently send SteamID64s you can use a big hack I wrote here in the mean time