We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const buf = Buffer.from([1,2,3]); console.log( buf.slice(1,2).buffer );
// display //ArrayBuffer { byteLength: 8192 }
The text was updated successfully, but these errors were encountered:
Unlike Uint8Array, Buffer uses a slice method that does not copy data but rather returns a view of the original buffer: https://nodejs.org/api/buffer.html#buffer_buf_slice_start_end
Uint8Array
Buffer
slice
So this result seems expected to me.
Sorry, something went wrong.
Thanks!
Closing as answered.
No branches or pull requests
const buf = Buffer.from([1,2,3]);
console.log( buf.slice(1,2).buffer );
// display
//ArrayBuffer { byteLength: 8192 }
The text was updated successfully, but these errors were encountered: