You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Length of the Buffer can be changed after creating the Buffer even though Buffer has fixed size. Writing outside of the buffers initial size will override content in other neighboring Buffers.
Here's a simple code where writing to a will override data in b
@hakovala buffers a really unsafe by design. Of course it's possible to make length non-writable using Object.defineProperty, but that implies performance hit. So, not modifying length is possibly the best option.
Length of the Buffer can be changed after creating the Buffer even though Buffer has fixed size. Writing outside of the buffers initial size will override content in other neighboring Buffers.
Here's a simple code where writing to
a
will override data inb
Output:
Reading is also possible. Printing content of
a
will print also content ofb
.Output:
The text was updated successfully, but these errors were encountered: