Skip to content

Commit ed34b09

Browse files
committed
Fixed: Reader#bytes should also support plain arrays
1 parent 0c6e639 commit ed34b09

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/reader.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ Reader.prototype.bytes = function read_bytes() {
306306
throw indexOutOfRange(this, length);
307307

308308
this.pos += length;
309+
if (Array.isArray(this.buf)) // plain array
310+
return this.buf.slice(start, end);
309311
return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1
310312
? new this.buf.constructor(0)
311313
: this._slice.call(this.buf, start, end);

0 commit comments

Comments
 (0)