统计一个文件的行数
来源:互联网 发布:java interface 程序 编辑:程序博客网 时间:2024/06/06 04:10
public int totalNumber(File file) { int result = 0; if (file != null && file.isFile()) { LineNumberReader lineNumberReader = null; try { lineNumberReader = new LineNumberReader(new FileReader(file)); /*Result of Method Call Ignored*/ lineNumberReader.skip(Long.MAX_VALUE); result = lineNumberReader.getLineNumber(); } catch (IOException e) { e.printStackTrace(); } finally { if (lineNumberReader != null) { try { lineNumberReader.close(); } catch (IOException e) { e.printStackTrace(); } } } } return result; }
0 0
- 统计一个文件的行数
- 如何统计一个文件的行数
- 统计一个项目的代码行数,只统计cpp文件
- 统计文件的行数
- 统计文件的行数
- 统计文件行数(包括只有一个换行符的行)
- 刚想到一个统计文件行数的方法
- java统计一个文件的字符数,单词数,行数
- 统计文件行数的shell
- 一个统计代码行数的程序C#
- 统计项目源代码文件的行数
- Linux统计文件行数
- Linux统计文件行数
- Linux统计文件行数
- 统计文件行数
- Linux统计文件行数
- 统计文件行数
- Linux统计文件行数
- k均值聚类+基于核的k均值聚类+C++实现
- 拉推模式总结
- 自定义View
- java 编程思想--初始化与清理
- Linux桌面版安装及开发环境配置
- 统计一个文件的行数
- 思路题(蚂蚁,uva 10881)
- Codeforces 91A-Newspaper Headline
- 如何求解问题-现代启发式方法_总结
- 提高Java代码质量的Eclipse插件之Checkstyle的使用详解
- AndroidStudio自定义注释
- MAC下卸载MySQL
- PCM转MP3音频文件(借助lame库)
- 程序 进程 线程之间的区别与联系