feat(http): add support for ArrayBuffer
Add the buffer option to store response in ArrayBuffer Improve the interface to get back response independently of the buffer type
This commit is contained in:

committed by
Jeff Cross

parent
0ccb6e0dfc
commit
1266460386
@ -38,4 +38,12 @@ export function getResponseURL(xhr: any): string {
|
||||
return;
|
||||
}
|
||||
|
||||
export function stringToArrayBuffer(string: String): ArrayBuffer {
|
||||
let view = new Uint16Array(string.length);
|
||||
for (var i = 0, strLen = string.length; i < strLen; i++) {
|
||||
view[i] = string.charCodeAt(i);
|
||||
}
|
||||
return view.buffer;
|
||||
}
|
||||
|
||||
export {isJsObject} from '../src/facade/lang';
|
||||
|
Reference in New Issue
Block a user