bufferedreader: read a file line by line module (BufferedReader vs Scanner vs Files.lines vs readAllLines on a 1 GB file; heap at -Xmx64m, timings, read-call counts, one-huge-line OOM, charset/BOM/line-terminator pitfalls, Scanner swallowing IOException), 10 contract tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b3pDoGLiWk6LLBeHjW
This commit is contained in:
Claude
2026-11-15 01:20:37 +05:30
parent 5faa57bb2d
commit f8c9e244a3
25 changed files with 809 additions and 0 deletions
@@ -0,0 +1,9 @@
-- BufferedReader --
got: line one
got: line two
IOException after 2 lines: simulated read failure (disk gone)
-- Scanner --
got: line one
got: line two
loop ended normally after 2 lines
sc.ioException() = java.io.IOException: simulated read failure (disk gone)