You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/03/06 18:39:00 UTC

[jira] [Commented] (CB-13245) Filereader.readAsText fails on Android with long text files when

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

ASF GitHub Bot commented on CB-13245:
-------------------------------------

infil00p commented on issue #217: CB-13245: (android) Fix bug caused by negative length reported for an asset
URL: https://github.com/apache/cordova-plugin-file/pull/217#issuecomment-370883325
 
 
   This should be fixed in Cordova, not in File.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Filereader.readAsText fails on Android with long text files when
> ----------------------------------------------------------------
>
>                 Key: CB-13245
>                 URL: https://issues.apache.org/jira/browse/CB-13245
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-file
>    Affects Versions: Master
>         Environment: Android 7.1.1
>            Reporter: Daniel Behnen
>            Priority: Major
>
> When reader.readAsText is called with an URI pointing to a local asset with a size greater than READ_CHUNK_SIZE = 256 * 1024, loading produces corrupt data. 
> The behaviour is caused by a negative length returned by CordovaResourceApi.openForRead() when the URI is a URI_TYPE_ASSET. Given the negative length, Filesystem.readFileAtURL() returns the whole file instead of the desired part and FileReader.readSuccessCallback() does not check the returned buffer size. Hence, the following chunks are attated to the buffer regardless of whether the file was already completely read.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org