javascript字符串和arrayBuffer转化,responseType:‘arrayBuffer’
字符串–》arrayBufferfunctionstringToArrayBuffer(str){//utf16不管是字符还是汉字letbuffer=newArrayBuffer(str.length*2);letview=newUint16Array(buffer)for(leti=0;i{letxhr=newXMLHttpRequest();xhr.open(method,url,true);