mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Introduce a readInt16
helper function in the src/core/core_utils.js
file
Rather than manually repeating code needed to get an int16, we can move and re-use an existing helper function instead.
This commit is contained in:
parent
b0b9552216
commit
237a17ad56
3 changed files with 17 additions and 14 deletions
|
@ -227,6 +227,10 @@ function readInt8(data, offset) {
|
|||
return (data[offset] << 24) >> 24;
|
||||
}
|
||||
|
||||
function readInt16(data, offset) {
|
||||
return ((data[offset] << 24) | (data[offset + 1] << 16)) >> 16;
|
||||
}
|
||||
|
||||
function readUint16(data, offset) {
|
||||
return (data[offset] << 8) | data[offset + 1];
|
||||
}
|
||||
|
@ -733,6 +737,7 @@ export {
|
|||
ParserEOFException,
|
||||
parseXFAPath,
|
||||
PDF_VERSION_REGEXP,
|
||||
readInt16,
|
||||
readInt8,
|
||||
readUint16,
|
||||
readUint32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue