Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msgpack.encode() writes into Uint8Array instead of Buffer #39

Open
kawanet opened this issue Jun 11, 2016 · 3 comments
Open

msgpack.encode() writes into Uint8Array instead of Buffer #39

kawanet opened this issue Jun 11, 2016 · 3 comments

Comments

@kawanet
Copy link
Owner

kawanet commented Jun 11, 2016

msgpack.decode() could read from Uint8Array object seamlessly, as well as Buffer object.

msgpack.encode() should allow an option to write into Uint8Array object, instead of Buffer object.

See also #38

@kawanet
Copy link
Owner Author

kawanet commented Jun 11, 2016

Proposal A:

var codec = msgpack.createCodec({uint8array: true});
var encoded = msgpack.encode(source, {codec: codec});
Object.prototype.toString.call(encoded); // => [object Uint8Array]

kawanet added a commit that referenced this issue Jun 18, 2016
@dbrgn
Copy link

dbrgn commented May 17, 2018

This can probably be closed, right?

@dukelec
Copy link

dukelec commented Jan 30, 2021

The dat[0].tmp is Uint8Array from msgpack.decode(frame).
The ppp is another Uint8Array create for test.

I tried many codec, but on the python server side, I can't make those two Uint8Array type the same behavior.

Screenshot_2021-01-30_20-37-20

OR

Screenshot_2021-01-30_20-28-38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants