mirror of
https://github.com/janeczku/calibre-web
synced 2025-12-05 15:58:05 +00:00
Merge branch 'Develop'
# Conflicts: # MANIFEST.in # README.md # cps/helper.py # cps/static/js/archive/archive.js # cps/translations/nl/LC_MESSAGES/messages.mo # cps/translations/nl/LC_MESSAGES/messages.po # cps/ub.py # cps/updater.py # cps/web.py # cps/worker.py # optional-requirements.txt
This commit is contained in:
0
cps/static/js/io/bitstream.js
Executable file → Normal file
0
cps/static/js/io/bitstream.js
Executable file → Normal file
@@ -101,6 +101,35 @@ bitjs.io = bitjs.io || {};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* ToDo: Returns the next n bytes as a signed number and advances the stream pointer.
|
||||
* @param {number} n The number of bytes to read.
|
||||
* @return {number} The bytes interpreted as a signed number.
|
||||
*/
|
||||
bitjs.io.ByteStream.prototype.movePointer = function(n) {
|
||||
this.ptr += n;
|
||||
// end of buffer reached
|
||||
if ((this.bytes.byteLength - this.ptr) < 0 ) {
|
||||
this.ptr = this.bytes.byteLength;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ToDo: Returns the next n bytes as a signed number and advances the stream pointer.
|
||||
* @param {number} n The number of bytes to read.
|
||||
* @return {number} The bytes interpreted as a signed number.
|
||||
*/
|
||||
bitjs.io.ByteStream.prototype.moveTo = function(n) {
|
||||
if ( n < 0 ) {
|
||||
n = 0;
|
||||
}
|
||||
this.ptr = n;
|
||||
// end of buffer reached
|
||||
if ((this.bytes.byteLength - this.ptr) < 0 ) {
|
||||
this.ptr = this.bytes.byteLength;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns n bytes as a sub-array, advancing the pointer if movePointers
|
||||
* is true.
|
||||
|
||||
Reference in New Issue
Block a user