question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to decode multiple objects in a single buffer?

See original GitHub issue

For example, currently the library behaves this way.

        const buf = new Uint8Array([1, 2]);
        console.log(unpack(buf)); // 1
        console.log(unpack(buf)); // 1

But we would like it to behave the following way.

        const buf = new Uint8Array([1, 2]);
        console.log(unpack(buf)); // 1
        console.log(unpack(buf)); // 2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kriszypcommented, Feb 3, 2021

Ok, published in v1.2.1

0reactions
Bilgecommented, Feb 3, 2021

Yes, I believe so. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Decode an array of messages in protobuf.js - Stack Overflow
Object '); const message = Object.decode(byteData); //this creates one object but the buffer contains multiple objects.
Read more >
Using Buffers in Node.js - DigitalOcean
There are many ways we can modify an existing buffer object. Similar to reading, we can modify buffer bytes individually using the array...
Read more >
Techniques | Protocol Buffers - Google Developers
Even though Protocol Buffers cannot handle the entire set at once, using Protocol Buffers to encode each piece greatly simplifies your problem: now...
Read more >
OpenGL Multiple Objects in One Buffer - YouTube
Shows storing multiple objects into one OpenGL vertex buffer object (VBO).
Read more >
Buffer | Node.js v19.3.0 Documentation
Converting a Buffer into a string using one of the above is referred to as decoding, and converting a string into a Buffer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found