I’m making a binary save-file for my game, and I actually need to save an HUGE amount of integers. Those values goes from 0 to 618, so a 2 bytes integer would be more than enough.
When I write an integer into a file using “System.IO.BinaryWriter” it occupies 4 bytes. Is there a way to use the half of it? Even because most of it are zeroes. (Maybe using a different type, I don’t know…)
I know that a data type called “binary” exists, but Google doesn’t really wants to help me, nor even Unity’s documentation.
I would approximately reduce the weight of my files by a factor of 2, and that’s a lot actually!