Hello. As I am not strong in node.js, I ask for help.
There is a binary file to read. I faced that I do not know how to read string. Can you help me with this question?
Here is my example:
var fs = require("fs"); fs.readFile('file.data', '', function(err, data) { if (err) throw err; var p = 0; console.log(data.readInt16LE(p));p+=2; console.log(data.readInt16LE(p));p+=2; console.log(data.readInt32LE(p));p+=4; var len = data.readInt32LE(p);p+=4; for (var i = 0; i < len; i++ ){ data.readInt32LE(p); p+=4; data.readString(64, p); p+=64; //Вот тут мне нужно прочитать string длинной 64 data.readInt32LE(p); p+=4; data.readInt32LE(p); p+=4; data.readInt32LE(p); p+=4; } console.log(data.readInt32LE(p));p+=4; console.log(data); console.log(p); });