How to make a polyvalent bit file in Haxe/OpenFL

Hello everyone !

In the idea to make a map file for a game, I want to use a file who contain some bit.
But I want it to work on Linux, Windows, Mac, Android, IOS and HTML5/Flash the same way !

I actually havn’t find any kind of file manipulating with those constrain neither documentation, so I’m very lost.

If you need more precision, I need to manipulate some byte number encoded in the file with 1 to 9 bit. In the idea to make a lightweighed file and a lightweighed reading.

I’ve all the algorithm to do these, but I don’t have the classes to manipulate the file.

It can be a byte file also, I will work with. :smile:
I’ve some clues about how to use, but it look when I look the sources that it’s not finished, and I found that kinda weird if not finished … And, mainly, havn’t found a clearly documentation about. :confused:

Sorry if I’m not clear enough, I can re-explain if needed.

Thanks for reading and for your answers.


If you use Assets.getBytes you should have a ByteArray, you can use ByteArray to read specific bytes as specific types (short, long, float, string, etc)

Does that help?

Yes, it would help for the final part, for the finished game that I make. Thanks you. :smile:

Now I just have to find how to write on one byte file, but it can be only for Windows, Linux, Mac, so it would be easier !

A big thanks you to you, have a nice day all !