Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was 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

Description

@vincentcr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions