怎样快速读完一本网络小说
2015-08-03 16:37
232 查看
首先,这是一遍技术文。
然后,没有然后了。
public class NovelReader { private static Logger log = LoggerFactory.getLogger(NovelReader.class); public static void main(String[] args) { String content = readFile("C:\\Users\\Mignet\\Documents\\雪中悍刀行.txt"); //\d\d[:]\d\d[:]\d\d[,]\d\d\d try { FileWriter fw = new FileWriter("C:\\Users\\Mignet\\Documents\\雪中悍刀行_mini.txt"); fw.write(content); fw.flush(); fw.close(); } catch (IOException e) { e.printStackTrace(); } // System.out.println(content); } public static String readFile(String filePath) { String fileContent = ""; File file = new File(filePath); if (file.isFile() && file.exists()) { try { InputStreamReader read = new InputStreamReader( new FileInputStream(file), "GBK"); BufferedReader reader = new BufferedReader(read); String line; try { while ((line = reader.readLine()) != null) { if((line.contains("第")&&line.contains("章"))||(line.contains("“")||line.contains("”"))){ log.info(line); fileContent += line + "\r\n"; } } reader.close(); read.close(); } catch (IOException e) { e.printStackTrace(); } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); } } return fileContent; } }
然后,没有然后了。
相关文章推荐
- 使用 libevent 和 libev 提高网络应用性能
- 【网络流】 HDOJ 3879 Base Station
- 转自http://bbs.pfan.cn/
- 提升linux下tcp服务器并发连接数限制
- 计算机网络(一)
- 网络号与主机号的计算以及子网的划分
- 第四周第一天(【URL(openStream()】【基于UDP的网络通信】)
- 计算机网络基础
- 计算机网络小结
- QTcpSocket类和QTcpServer类
- Json网络解析
- Json网络解析
- java程序设置http,socks代理
- TCP协议详解(三)
- curl -XPOST "http://localhost:9200/posts" -d @posts.json
- http://blog.sina.com.cn/s/blog_618199e60100y537.html
- plsql dev查询偶尔卡死,Windows上如何禁用TCP/IP自动调优特性
- VMware Workstation克隆CentOS 没有网卡eth0 无法开启网络服务
- Dubbo处理TCP拆包粘包问题
- 社会友谊和人群移动:基于位置的社交网络中的用户移动(二)