File f = new File("test.txt");
long len = f.length();
long len = f.length();
解决方案 »
- java小应用程序的图标!
- error和exception有什么区别?
- struts2 interceptor异常
- 登录验证问题
- 『急』关于Calendar类使用的怪问题,11月怎么会有11月31日????
- 私有构造器的问题。大家来看看
- 请问Timer类 方法scheduleAtFixedRate,是作什么用的
- 刚开始学JAVA
- 关于javascript的常用函数问题
- junit5测试run的时候idea提示Failed to resolve org.junit.platform:junit-platform-launcher
- 请大家推荐一本关于数据结构和算法的书,最好是java中文版的,下班前结贴
- if ( (y++>2) && (y++<2) | (y++>2)) & ++ 的问题?
* Returns the length of the file denoted by this abstract pathname.
* The return value is unspecified if this pathname denotes a directory.
*
* @return The length, in bytes, of the file denoted by this abstract
* pathname, or <code>0L</code> if the file does not exist
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* method denies read access to the file
*/
public long length() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
return fs.getLength(this);
}