Skip to content

Why the buffer requires to pass the offset, better buffer class? #16710

@bugproof

Description

@bugproof

For example buf.readUInt8(offset[, noAssert]) I wonder why not simply buf.readUInt8()? It's just adding the offset. For example take a look at QDataStream of Qt framework.

Also, why int8 and not just boolean? How can I convert int8 to boolean? This is javascript not C++

IMO the official Buffer class is really bad and lacking simplicity. Or there should be another class like BinaryStream, BitStream.

I have a client in C++ and server in node and I'm sending binary data to node. I find it really uncomfortable to use Buffer class to deserialize my data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wrong repoIssues that should be opened in another repository.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions