Trying to read a binary data file in the assets directory of android app:
void loadFile(InputStream filein){
log(filein.available()); // returns 11310099
int a = filein.read(); // returns -1 (i.e. EOF)
}
// Function was called using:
loadFile(context.getAssets().open("filename.dat"));
So if available() correctly returns that there is 11MB of data available in the filehandle, how can read() immediately return -1 as soon as I try to read the first byte?