You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Becky Gibson (Commented) (JIRA)" <ji...@apache.org> on 2012/04/05 21:52:24 UTC

[jira] [Commented] (CB-390) File IO Encoding and Performance iOS

    [ https://issues.apache.org/jira/browse/CB-390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247580#comment-13247580 ] 

Becky Gibson commented on CB-390:
---------------------------------

There is no method on the FileWriter to support an encoding so UTF is always used in order to support non-ascii data. 

The reason for not using the NSString writeToFile method (which  now requires the specification of an encoding) is that it doesn't allow for appending - it overwrites any existing file at that path.  We could possibly use  stringWithContentsOfFile: usedEncoding: error to read the file but I don't think that will affect the performance.   I'm open to modifying the code to be more efficient but changing from using NSOutputStream to using NSString methods would require more involved error checking for file existence and more work to append to an existing file.  


                
> File IO Encoding and Performance iOS 
> -------------------------------------
>
>                 Key: CB-390
>                 URL: https://issues.apache.org/jira/browse/CB-390
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.5.0
>            Reporter: Lee Crossley
>            Assignee: Shazron Abdullah
>
> The performance of the Apache Callback / Cordova file IO operations on iOS is causing problems (memory exceptions for large files). The encoding should be removed, as it is not required and there also is double (triple) buffer allocation. NSString has a read method, so why isn't that just used?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira