bytebuffer.js icon indicating copy to clipboard operation
bytebuffer.js copied to clipboard

Create ByteBuffer from existing ArrayBuffer?

Open stodge opened this issue 6 years ago • 2 comments
trafficstars

This is probably a silly question, but how can I initialise a ByteBuffer instance from an existing ArrayBuffer? Thanks

stodge avatar Jul 17 '19 17:07 stodge

Seems you are looking for: https://github.com/protobufjs/bytebuffer.js/wiki/API#bytebufferwrapbuffer-encoding-littleendian-noassert

dcodeIO avatar Jul 17 '19 17:07 dcodeIO

Thanks - I tried that but I couldn't get it to work. Let me try again.

For context, I'm trying to parse binary data from a websocket.

stodge avatar Jul 17 '19 17:07 stodge