source/jquery.flot.composeImages.js
function buildBinaryString (arrayBuffer) {
            var binaryString = "";
            const utf8Array = new Uint8Array(arrayBuffer);
            const blockSize = 16384;
            for (var i = 0; i < utf8Array.length; i = i + blockSize) {
                const binarySubString = String.fromCharCode.apply(null, utf8Array.subarray(i, i + blockSize));
                binaryString = binaryString + binarySubString;
            }
            return binaryString;
        }
function buildBinaryString (arrayBuffer) {
            var binaryString = "";
            const utf8Array = new Uint8Array(arrayBuffer);
            const blockSize = 16384;
            for (var i = 0; i < utf8Array.length; i = i + blockSize) {
                const binarySubString = String.fromCharCode.apply(null, utf8Array.subarray(i, i + blockSize));
                binaryString = binaryString + binarySubString;
            }
            return binaryString;
        }
function buildBinaryString ( arrayBuffer ) { var binaryString = "" ; const utf8Array = new Uint8Array ( arrayBuffer ) ; const blockSize = 16384 ; for ( var i = 0 ; i < utf8Array . length ; i = i + blockSize ) { const binarySubString = String . fromCharCode . apply ( null , utf8Array . subarray ( i , i + blockSize ) ) ; binaryString = binaryString + binarySubString ; } return binaryString ; }
Use this method to convert a string buffer array to a binary string. Do so by breaking up large strings into smaller substrings; this is necessary to avoid the "maximum call stack size exceeded" exception that can happen when calling 'String.fromCharCode.apply' with a very long array.
Use this method to convert a string buffer array to a binary string . Do so by breaking up large strings into smaller substrings ; this is necessary to avoid the maximum call stack size exceeded exception that can happen when calling String . fromCharCode . apply with a very long array .