 							case ResponseType.UINT8ARRAY:
 								return resolve(byteArray);
 							case ResponseType.DATAURI:
-								return resolve("data:" + (urlRequest.mimeType || '') + ';base64,' + JS.global.btoa(byteArray));
+								return resolve(byteArrayToDataUri(byteArray, urlRequest.mimeType));
 						}
 					});
 				});

						
						if (urlRequest.responseType === ResponseType.UINT8ARRAY)
							result = new JS.Uint8Array(result);
						
						resolve(result);
						done = true;


	public class URLRequestUtils implements IURLRequestUtils
	{
		private function byteArrayToDataUri(byteArray:/*Uint8*/Array, mimeType:String):String
		{
			return "data:" + (mimeType || '') + ';base64,' + JS.global.btoa(byteArray);
		}
		
		private function byteArrayToString(byteArray:/*Uint8*/Array):String
		{
			var CHUNK_SIZE:int = 8192;
