BufferedReader 最快的读取每一行 @Test public void bufferReaderTest() { try (BufferedReader buffere
最快的读取每一行
@Test public void bufferReaderTest() { try (BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\aa.txt"))) { String line; while ((line = bufferedReader.readLine()) != null) { // 处理每一行数据 ..... } } catch (Exception e) { log.error(e.getMessage(), e); } }
相比较Scanner慢一点
@Test public void scannerTest() { try (Scanner scanner = new Scanner(new File("D:\\aa.txt"))) { while (scanner.hasNextLine()) { // 处理每一行数据 ..... String line = scanner.nextLine(); } } catch (Exception e) { log.error(e.getMessage(), e); } }
行数达到一定规模,使用此方法读取会非常慢
@Test public void randomAccessFileTest() { try (RandomAccessFile accessFile = new RandomAccessFile("D:\\aa.txt", "r")) { String line; while ((line = accessFile.readLine()) != null) { // 处理每一行数据 ..... } } catch (Exception e) { log.error(e.getMessage(), e); } }
一次把所有数据都读到内存中,当文件非常大时,会消耗掉内存资源导致程序崩掉,文件规模小推荐使用
@Test public void filesTest() { try { List<String> lines = Files.readAllLines(Paths.get("D:\\aa.txt")); lines.forEach(line -> { // 处理每一行数据 ..... }); } catch (Exception e) { log.error(e.getMessage(), e); } }
统计每一行日志ip出现的次数
package io;import lombok.extern.slf4j.Slf4j;import org.junit.Test; import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import java.io.RandomAccessFile;import java.NIO.file.Files;import java.nio.file.Paths;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Scanner;@Slf4jpublic class ReadLineTest { private final String FILE_NAME = "D:\\aa.txt"; private Map<String, Integer> StringMap = new HashMap<>(); @Test public void bufferReaderTest() { try (BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\aa.txt"))) { String line; while ((line = bufferedReader.readLine()) != null) { // 处理每一行数据 ..... processLines(line); } } catch (Exception e) { log.error(e.getMessage(), e); } print("BufferedReader"); } @Test public void scannerTest() { try (Scanner scanner = new Scanner(new File(FILE_NAME))) { while (scanner.hasNextLine()) { // 处理每一行数据 ..... String line = scanner.nextLine(); processLines(line); } } catch (Exception e) { log.error(e.getMessage(), e); } print("Scanner"); } @Test public void randomAccessFileTest() { try (RandomAccessFile accessFile = new RandomAccessFile(FILE_NAME, "r")) { String line; while ((line = accessFile.readLine()) != null) { // 处理每一行数据 ..... processLines(line); } } catch (Exception e) { log.error(e.getMessage(), e); } print("RandomAccessFile"); } @Test public void filesTest() { try { List<String> lines = Files.readAllLines(Paths.get(FILE_NAME));// lines.forEach(line -> {// // 处理每一行数据 .....// processLines(line);// }); // 处理每一行数据 .....,方法引用更简洁 lines.forEach(this::processLines); } catch (Exception e) { log.error(e.getMessage(), e); } print("Files.readAllLines"); } private void print(String name) { log.info("************* {} *******************", name); StringMap.forEach((k, v) -> { if (v != 1) { log.info("ip: {} count: {}", k, v); } }); StringMap.clear(); } private void processLines(String line) { String[] subLine = line.split(" "); String ip = subLine[subLine.length - 1]; if (StringMap.containsKey(ip)) { Integer integer = StringMap.get(ip); StringMap.put(ip, integer + 1); } else { StringMap.put(ip, 1); } }}
2023-04-14 09:50:51,211 INFO [springContextShutdownHook] c.i.w.i.websocketServiceImpl.onClosing(496) : connection close 192.168.8.1722023-04-14 09:50:51,211 INFO [SprinGContextShutdownHook] c.i.w.i.WEBSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.692023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1592023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1612023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.682023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1862023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.742023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.952023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.872023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1272023-04-14 09:50:51,215 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.912023-04-14 09:50:51,215 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1152023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1982023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1052023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.772023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1252023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1732023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1292023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2082023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2112023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.632023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1702023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1952023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1812023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1802023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.612023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2012023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.902023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.262023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2002023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1262023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1922023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.962023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.592023-04-14 09:50:51,222 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.502023-04-14 09:50:51,222 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,222 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1252023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.822023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1502023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2092023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1702023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.512023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1522023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.212023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.712023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.882023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1882023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1872023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.812023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1552023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.572023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1482023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1562023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1542023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1462023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1602023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1232023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,228 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1842023-04-14 09:50:51,228 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1512023-04-14 09:50:51,228 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1822023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1132023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.892023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1912023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2052023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.742023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1272023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1572023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1652023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1222023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1622023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1832023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2022023-04-14 09:50:51,232 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1662023-04-14 09:50:51,232 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2102023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.932023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1712023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2042023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2072023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1992023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1242023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1232023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1072023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1692023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.762023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.942023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1762023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.242023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1772023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.232023-04-14 09:50:51,238 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1492023-04-14 09:50:51,238 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.752023-04-14 09:50:51,238 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.622023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.702023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1972023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1742023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1142023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1212023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1892023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1062023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1262023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1532023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1672023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1902023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1752023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2062023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1082023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1122023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1942023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.252023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1852023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1792023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.602023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1172023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.642023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1932023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.922023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1472023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1162023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1012023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1962023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.2032023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.862023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1632023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1782023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.672023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.972023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1452023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1582023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1242023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1112023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.992023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.1282023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.1682023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.1282023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.222023-04-14 09:50:51,252 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.164
来源地址:https://blog.csdn.net/qq_40965479/article/details/130194793
--结束END--
本文标题: java 逐行读取文件(读取文件每一行、按行读取文件)附带示例代码
本文链接: https://lsjlt.com/news/403314.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-04-01
2024-04-03
2024-04-03
2024-01-21
2024-01-21
2024-01-21
2024-01-21
2023-12-23
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0