1
0
Fork 0
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:
Jonas Jenwald 2014-09-11 16:33:49 +02:00
parent 0674a3bd02
commit d1974eae34
3 changed files with 18 additions and 2 deletions

View file

@ -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;