joyent/node — Issue #2320: fs.createReadStream returns wrong data when bufferSize is not an integer
Author: vincentcr
Created: 2011-12-12 21:01:23+00:00
State: open

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.