Fixed geBytes implementation
This commit is contained in:
parent
19f9897ec3
commit
c326f1808f
13
pdf.js
13
pdf.js
@ -73,7 +73,10 @@ var Stream = (function() {
|
|||||||
length = end - pos;
|
length = end - pos;
|
||||||
|
|
||||||
var n = 0;
|
var n = 0;
|
||||||
var buf = new Uint8Array(bytes, pos, length);
|
var buf = new Uint8Array(length);
|
||||||
|
while (n < length)
|
||||||
|
buf[n++] = bytes[pos++]
|
||||||
|
this.pos = pos;
|
||||||
return buf;
|
return buf;
|
||||||
},
|
},
|
||||||
lookChar: function() {
|
lookChar: function() {
|
||||||
@ -320,7 +323,13 @@ var FlateStream = (function() {
|
|||||||
if (length > bufferLength - bufferPos)
|
if (length > bufferLength - bufferPos)
|
||||||
length = bufferLength - bufferPos;
|
length = bufferLength - bufferPos;
|
||||||
|
|
||||||
return new Uint8Array(this.buffer, bufferPos, length);
|
var buffer = this.buffer;
|
||||||
|
var retBuffer = new Uint8Array(length);
|
||||||
|
var n = 0;
|
||||||
|
while (n < length)
|
||||||
|
retBuffer[n++] = buffer[bufferPos++];
|
||||||
|
this.bufferPos = bufferPos;
|
||||||
|
return retBuffer;
|
||||||
},
|
},
|
||||||
lookChar: function() {
|
lookChar: function() {
|
||||||
var bufferLength = this.bufferLength;
|
var bufferLength = this.bufferLength;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user