Bug 8858 - Using Assets.OpenFd on binary files throws an exception
Summary: Using Assets.OpenFd on binary files throws an exception
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.8.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-12-09 23:09 UTC by Prashant Cholachagudda
Modified: 2017-06-29 03:12 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

A test app demonstrating the bug (262.17 KB, application/octet-stream)
2012-12-09 23:09 UTC, Prashant Cholachagudda

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Prashant Cholachagudda 2012-12-09 23:09:59 UTC
Created attachment 3074 [details]
A test app demonstrating the bug

I'm trying to get a assets file size, when I use Assets.OpenFd(filename) I get a java.io.FileNotFoundException for binary files or non image file.

I have attached a sample code demonstrating the problem. 
Is there any other options to get assets file size?
Comment 1 Miguel de Icaza [MSFT] 2013-05-22 14:32:06 UTC

DId ou figure a way to solve this issue?   I am setting the bug to NEEDINFO, please reopen if you did not find an alternative, or resolve as fixed if you did, and add the solution to the bug
Comment 2 Prashant Cholachagudda 2013-05-27 10:04:02 UTC
If we change the file extension to anything other than LNG for the asset file "ITALIANO.LNG" it work!