* @param {?function()} callback If a function is passed then this function will be asynchronous and the callback invoked when the blocks have been loaded, otherwise it blocks script execution until the request is completed.
*/
functionwaitForBlocks(blockRange,callback){
// Filter out already downloaded blocks or return if found out that
// the entire block range has already been downloaded.
* Gets the number of total bytes that have been downloaded.
*
* @returns The number of total bytes that have been downloaded.
*/
this.getDownloadedBytesCount=function(){
returndownloadedBytesCount;
};
/**
* Downloads the byte range given. Useful for preloading.
*
* @param {Array} range Two element array that denotes the first byte to be read on the first position and the last byte to be read on the last position. A range of [2, 5] will download bytes 2,3,4 and 5.
* @param {?function()} callback The function to invoke when the blocks have been downloaded, this makes this call asynchronous.