You write the bytes from the array byte by byte to a file.
For reading you do the exact same thing again vice versa, no need to use any kind of encoding or whatnot.