i want to use ferros buffer in my application. but i receive error when trying to save the buffer to file. here is my code : please kindly help to check...
var fs = require('fs');
var B = require('buffer/').Buffer;
var buffin = fs.readFileSync('calibri.ttf');
var b64 = buffin.toString('base64');
var bf = new B(b64,'base64');
fs.writeFile('calibro.ttf', bf, function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
here is my error message :
D:\Project\testbuffer\node_modules\buffer\index.js:703
return String.fromCharCode.apply(String, res)
^
RangeError: Maximum call stack size exceeded
at utf8Slice (D:\Project\testbuffer\node_modules\buffer\index.js:703:30)
at Buffer.toString (D:\Project\testbuffer\node_modules\buffer\index.js:412:3
8)
at fs.js:1079:63
at FSReqWrap.oncomplete (fs.js:95:15)
please kindly help,
This issue has already fixed on the latest version of feross buffer. thanks.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.