我想在 Android 中查找文件的大小。我最初希望它像 File 中的 size() 方法一样简单,或者类似的东西。但我什么也没找到。任何帮助将不胜感激。
谢谢
最佳答案
使用file.length()
http://download.oracle.com/javase/6/docs/api/java/io/File.html#length%28%29
The length, in bytes, of the file denoted by this abstract pathname, or 0L if the file does not exist. Some operating systems may return 0L for pathnames denoting system-dependent entities such as devices or pipes.
关于java - 如何在Android中计算文件的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5838306/