Skip to content

Commit

Permalink
Concatenate the bytes properly into the new Uint8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
codedread committed Jun 30, 2024
1 parent c15d683 commit ab98fc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ export class Book extends EventTarget {
*/
appendBytes(appendBuffer) {
let newBuffer = new Uint8Array(this.#arrayBuffer.byteLength + appendBuffer.byteLength);
newBuffer.set(this.#arrayBuffer, 0);
newBuffer.set(appendBuffer, this.#arrayBuffer.byteLength);
newBuffer.set(new Uint8Array(this.#arrayBuffer), 0);
newBuffer.set(new Uint8Array(appendBuffer), this.#arrayBuffer.byteLength);
this.#arrayBuffer = newBuffer;
}

Expand Down

0 comments on commit ab98fc1

Please sign in to comment.