Reputation: 113365
How can I fill a buffer with emptiness?
This was working on v0.10.*:
var b = new Buffer(8192);
b.fill("");
But it just crashes without any error on v0.11.11
.
I have this code:
var b = new Buffer(8192);
b.fill("");
console.log(1);
When I run it, 1
doesn't appear in output. What alternatives are to fill a buffer with emptiness?
Upvotes: 0
Views: 89
Reputation: 72885
Originally I suggested new Buffer(Array(32))
, but we determined b.fill(0)
was a workable solution.
Upvotes: 2