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

Buffer api for conversion from/to ArrayBuffer #535

Closed
kyriosli opened this issue Jan 21, 2015 · 2 comments
Closed

Buffer api for conversion from/to ArrayBuffer #535

kyriosli opened this issue Jan 21, 2015 · 2 comments

Comments

@kyriosli
Copy link

Js side conversion (like new Uint8Array(buffer) or new Buffer(bufferView)) is really slow cause it treats input as an integer array rather than a pointer to a memory address.

In older version of node.js which is compiled with v8 that does not support ArrayBuffer, ArrayBufferViews are constructed with node's Buffer, so there is no such problem.

Could we afford a new api like:

    var buf = new Buffer(1<<28);
    var arrBuf = buf.toArrayBuffer();
    var buf2 = Buffer.fromArrayBuffer(arrBuf);
@Fishrock123
Copy link
Contributor

Partial Duplicate of #106

@Fishrock123
Copy link
Contributor

Duplicate of #177

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

2 participants