Getting a wrong FileChannel size
问题 I'm trying to get the size of a file contained in assets . I'm using a FileChannel because I need a FileChannel later. The file myfile.txt contains 7 bytes. Here is my code: AssetManager amgr; AssetFileDescriptor afd; FileChannel fchIn; FileInputStream fis; amgr=context.getAssets(); afd=amgr.openFd("myfile.txt"); fis=afd.createInputStream(); fchIn=fis.getChannel(); Log.d("mytag", fchIn.size()); Log.d("mytag", fis.available()); And the output is: 7237492 7 Why is the size returned by the