Skip to content
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
@vincentcr

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions