开发者

binary read android assets

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜