Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Thu, 07 Aug 2025 05:38:56 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3750: Use `BufferedInputStream` with `FileInputStream` In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 3162565793 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3750 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3750#issuecomment-3162565793 Content-Type: text/plain; charset=utf-8 `FileUtils` is indeed a better class name. > The reason being: if you are always going to expect file streams to be buffered, then there is no real point to put it in the name. If you want a file stream, it will be buffered, whether you like it or not Well, `Files.newBufferedReader` does have `Buffered` in the name. I just thought having `.newBufferedInputStream` would would convey the intent. >The exclusions list references an imaginary `Unsafe.class` file. Should I replace that with the new file? Let's replace it indeed. > Should test code be excluded or updated to use the new util? AFAIK there are two instances, and they are worth updating: > `new StrangeInputStream(seed, new FileInputStream("target/buffer.txt"));` It is fine to convert to a new util method. It looks like a true case when the necessary buffering was missing. > `new BufferedReader(new InputStreamReader(new FileInputStream(path)));` It could rather be `Files.newBufferedReader(...)` instead