Binary files can actually be written and read the same way as text files. The binary files are, of course, not readable in a text editor, but they can easily be read back into AX again.
The only change you have to make to the previous two examples is to use the
BinaryIo class instead of the
The use of binary files to export data from AX is rare, as the data will only be readable from AX. You can use it if you don't want the data exported to be readable outside AX.