The issue is that what actually happens when writing numbers to a file doesn't follow that description, as is apparent when trying to read the value back. You get something different than what you wrote.

The engine writes two bytes per value to files, in little-endian format. Except that for negative numbers between -1 and -255 it writes the same bytes as for the positive numbers between 255 and 1.