/** * 获取文件长度 * @return */ public static long getFileSize(String filePath){ String path=filePath; File file = new File(path); long size=0; if(file.isFile() && file.exists()){//判断文件是否存在 size=file.length(); }else{ System.out.println("该文件不存在"); } return size; }
获取文件长度
猜你喜欢
转载自nxdjava.iteye.com/blog/2398182
今日推荐
周排行