Here’s a class that handles reading/writing specifically geared to writing little-endian’d shorts/words as well as indirection. It just handles the stuff so you don’t have to worry about it. You can either explicitly specify offsets, or you can use seek() like a normal file IO operation.