Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Tue, 05 Aug 2025 07:31:54 +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: 3153845898 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2025-08-05T07:50:02Z X-GitHub-Issue: 3750 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3750#issuecomment-3153845898 Content-Type: text/plain; charset=utf-8 For reference, it looks like `Files.newInputStream` could be the way to go (it does not seem to require `BufferedInputStream`), however, it does not seem to be good enough for Java 8. See: * https://github.com/jetty/jetty.project/issues/3840 * https://bugs.openjdk.org/browse/JDK-8227080 (fs) Files.newInputStream(...).skip(n) is slow. It is fixed in Java 14 and back-ported to Java 11. At the same time, `Files.newInputStream` says "the stream will not be buffered", so it would require buffering anyways.