if (native_.isFailure(result)) {
throw new WebAPIException(WebAPIException.IO_ERR, 'Could not read');
}
- var encoded = native_.getResultObject(result);
+ var decoded = Base64.decodeString(native_.getResultObject(result));
+
+ if (decoded.length) {
+ can_change_size = true;
+ this.position += decoded.length;
+ can_change_size = false;
+ } else {
+ this.position += 1; // Set EOF
+ }
- return Base64.decodeString(encoded);
+ return decoded;
};
FileStream.prototype.read = function() {
if (native_.isFailure(result)) {
throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Could not read');
}
- var encoded = native_.getResultObject(result);
- return Base64.decode(encoded);
+ var decoded = Base64.decode(native_.getResultObject(result));
+
+ if (decoded.length) {
+ can_change_size = true;
+ this.position += decoded.length;
+ can_change_size = false;
+ } else {
+ this.position += 1; // Set EOF
+ }
+
+ return decoded;
};
FileStream.prototype.readBytes = function() {
throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Could not read');
}
var encoded = native_.getResultObject(result);
+ var decoded = Base64.decode(encoded);
+
+ if (decoded.length) {
+ can_change_size = true;
+ this.position += decoded.length;
+ can_change_size = false;
+ } else {
+ this.position += 1; // Set EOF
+ }
return encoded;
};
if (native_.isFailure(result)) {
throw new WebAPIException(WebAPIException.IO_ERR, 'Could not write');
}
+
+ var decoded = Base64.decode(args.base64Data);
+
+ can_change_size = true;
+ this.position += decoded.length;
+ can_change_size = false;
};
FileStream.prototype.writeBase64 = function() {