I need to write a sequence of boolean and float values to a file in binary using Javascript. I would like to keep the file open and then just do a sequence of writes. Here is the pseudocode of what I would like to accomplish
file = open('filename.dat', 'ab') // open in "append binary" mode
file.write(true); // write 1 bit to file
file.write(3.14) // write 64 bit float number to file
file.close()
Does anyone know how to do this in Javascript? Thanks a lot.