Skip to content

Add support for size calculation when writing #87

Description

@rain1

Currently the serialization of json into object looks like this:

// template and obj definitions
const buffer = new ArrayBuffer(10);
const jbOut = new jBinary(buffer, template);
jbOut.write('parent', obj);

Problem is that if actual object is more than 10 bytes it gets: Uncaught RangeError: offset is outside the bounds of the DataView.

It would be cool if size calculation was included in jBinary so that I would not have to traverse the structure myself.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions