mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Add peekByte method to Stream, DecodeStream and ChunkedStream
This commit is contained in:
parent
0674a3bd02
commit
d1974eae34
3 changed files with 18 additions and 2 deletions
|
@ -195,6 +195,12 @@ var ChunkedStream = (function ChunkedStreamClosure() {
|
|||
return bytes.subarray(pos, end);
|
||||
},
|
||||
|
||||
peekByte: function ChunkedStream_peekByte() {
|
||||
var peekedByte = this.getByte();
|
||||
this.pos--;
|
||||
return peekedByte;
|
||||
},
|
||||
|
||||
peekBytes: function ChunkedStream_peekBytes(length) {
|
||||
var bytes = this.getBytes(length);
|
||||
this.pos -= bytes.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue