This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
fs.createReadStream returns wrong data when bufferSize is not an integer #2320
Closed
Description
i know it seems like a weird thing to do but it was part of a unit test that now fails with 0.6.x:
var buf = new Buffer('abcdefghij', 'utf8');
var bufSize = buf.length / 3; // === 3.33
var stream = fs.createReadStream(buf, bufferSize: bufSize);
the last buffer returned by the stream data event is trash.
I believe this issue is related to #1758, because flooring bufSize makes it go away.
Activity