I have to create 开发者_运维技巧progressbar so that i need the size of a file.so please give me the sample code that i can calculate size of server side file.
long fileSize = new FileInputStream(filePath).getChannel().size();
For the record, when you google "android calculate size of file on disk" this page comes up. So, I'm answering that question, even though the title of this is pretty odd. Maybe someone else with more power can rewrite the question or something.
精彩评论