feross/buffer — pull request #23 by devongovett (2014-04-08 07:27:28+00:00)
Title: Fix copy with typed arrays

Creating a new `Uint8Array` from the `this.buffer` doesn't work if `subarray` had previously been used (e.g. `slice`), since `this.buffer` still would refer to the start of the buffer, not the start of the subarray. We can use `subarray` here instead, which keeps previous subarray indices intact. I was getting weird behavior in 2.1.7 otherwise.