[Filesystem] Fixed readBytes().
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 1 Sep 2015 10:16:39 +0000 (12:16 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 1 Sep 2015 10:16:39 +0000 (12:16 +0200)
Error detected while working with XWALK-737.

[Verification] TCT pass rate did not change.

Change-Id: Icd0235faf42666cecb747558de7bc2d0334de189
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/filesystem/js/file_stream.js
src/utils/utils_api.js

index 289ede66b02ee73cb30c698cd12c44b377b0b5d8..b0e8953beb039e484c116255a270188e870d6d94 100755 (executable)
@@ -159,13 +159,10 @@ FileStream.prototype.readBytes = function() {
   if (native_.isFailure(result.reply)) {
     throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Could not read');
   }
-  var bytes = [];
-  for (var i = 0; i < result.output.length; ++i) {
-    bytes.push(result.output.charCodeAt(i));
-  }
+
   this.position = this.position + result.reply.data_size;
 
-  return bytes;
+  return result.output;
 };
 
 FileStream.prototype.readBase64 = function() {
index 445adeddc9dda5a95d8154a8d645803fce761f18..dcee69ca6ce0ac49016eff6b456552afba37c0be 100755 (executable)
@@ -1051,7 +1051,7 @@ NativeManager.prototype.callSyncData = function(cmd, args, type, chunk) {
   });
   var response = this.extension.sendSyncData(request, chunk);
   response.reply = JSON.parse(response.reply);
-  response.output = this.extension.receiveChunkData(response.chunk_id, "string");
+  response.output = this.extension.receiveChunkData(response.chunk_id, type);
   return response;
 };