I want to use this method in order to get an estimated number of bytes that can be read in a JsonFile from the Asset.
For that I wrote this code:
Stream mf = Context.Assets.Open(filename);
int size= mf.Available();
InputStream mf = AssetManager.Open(filename);
If you want the actual Asset file size, there are two things you need to do:
1st: Set the file NOT to be compressed
Example, change extension to something unique, i.e.
Set those file extensions not to be compressed in your app package:
2nd: Use an asset file descriptor:
var fileFD = Assets.OpenFd("json.utxt"); Log.Debug("JSON", fileFD.Length.ToString());