Normally, I would expect that the following would be good enough to represent binary data in a Buffer:
new Buffer('01001000','binary')
but I am pretty certain Node.js/JS does not support this 'binary' encoding.
What is the best way then to write binary data to a buffer?
Copyright Notice:Content Author:「Alexander Mills」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41729267/writing-binary-data-to-buffer