File f = new File("test.txt");
long len = f.length();
long len = f.length();
解决方案 »
- Java提取网页内容中文为乱码的问题~~
- java 输入输出流小问题(注释部分是提问)
- 怎么监听组合按键
- java中实现按“enter”键登陆
- 初学JBulider2005,菜鸟问题,送高分求解………………!!
- 关于java中的代码点与代码单元
- 不知是哪里设错了,急!
- ipanlet问题:我在方法中用:System.out.println()打印时是打到什么地方去了,我找不到
- 请介绍几个好的JBuilder网站,国内的和国外的
- 计算地图上的一些点是否在某个范围内
- 请大家推荐一本关于数据结构和算法的书,最好是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);
}