This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git

commit f12779cb2a0e1a1260d4ec5129990c9348c49e6f
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Apr 3 08:57:11 2025 -0400

    Pass the class' builder internally
---
 .../apache/commons/io/input/MemoryMappedFileInputStream.java  | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java 
b/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
index 2472525e9..53711c4ae 100644
--- a/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
@@ -122,7 +122,7 @@ public Builder() {
          */
         @Override
         public MemoryMappedFileInputStream get() throws IOException {
-            return new MemoryMappedFileInputStream(getPath(), getBufferSize());
+            return new MemoryMappedFileInputStream(this);
         }
     }
 
@@ -156,13 +156,12 @@ public static Builder builder() {
     /**
      * Constructs a new instance.
      *
-     * @param file The path of the file to open.
-     * @param bufferSize Size of the sliding buffer.
+     * @param builder The builder.
      * @throws IOException If an I/O error occurs.
      */
-    private MemoryMappedFileInputStream(final Path file, final int bufferSize) 
throws IOException {
-        this.bufferSize = bufferSize;
-        this.channel = FileChannel.open(file, StandardOpenOption.READ);
+    private MemoryMappedFileInputStream(final Builder builder) throws 
IOException {
+        this.bufferSize = builder.getBufferSize();
+        this.channel = FileChannel.open(builder.getPath(), 
StandardOpenOption.READ);
     }
 
     @Override

Reply via email to