/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/java/java-503-101-033/main.java
26 строк
811 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
public class FileProcessor { public void processLargeFile(Path filePath) throws IOException { try (BufferedReader reader = Files.newBufferedReader(filePath)) { String line; while ((line = reader.readLine()) != null) { processLine(line); } } } public void writeLargeFile(Path filePath, List<String> lines) throws IOException { try (BufferedWriter writer = Files.newBufferedWriter(filePath)) { for (String line : lines) { writer.write(line); writer.newLine(); } } } public long countLines(Path filePath) throws IOException { try (Stream<String> lines = Files.lines(filePath)) { return lines.count(); } } }