Skip to content

Commit

Permalink
Make readFixed return a Uint8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Mar 30, 2024
1 parent afdca9a commit 3e4bce6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ class Tap {
newArr.set(this.arr, 0);
newArr.set(newBuf, this.arr.length);
this.setData(newArr, 0);
//this.setData(Buffer.concat([this.arr, newBuf]));
}

forward (newBuf) {
Expand All @@ -561,7 +560,6 @@ class Tap {
newArr.set(subArr, 0);
newArr.set(newBuf, subArr.length);
this.setData(newArr, 0);
//this.setData(Buffer.concat([this.arr.subarray(this.pos), newBuf]));
}

/**
Expand Down Expand Up @@ -730,9 +728,7 @@ class Tap {
if (this.pos > this.length) {
return;
}
// TODO: return a plain Uint8Array as a breaking change once services is
// removed.
return Buffer.from(this.arr.slice(pos, pos + len));
return this.arr.slice(pos, pos + len);
}

skipFixed (len) { this.pos += len; }
Expand Down

0 comments on commit 3e4bce6

Please sign in to comment.