Skip to content

Commit f12779c

Browse files
committed
Pass the class' builder internally
1 parent aadc8c9 commit f12779c

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public Builder() {
122122
*/
123123
@Override
124124
public MemoryMappedFileInputStream get() throws IOException {
125-
return new MemoryMappedFileInputStream(getPath(), getBufferSize());
125+
return new MemoryMappedFileInputStream(this);
126126
}
127127
}
128128

@@ -156,13 +156,12 @@ public static Builder builder() {
156156
/**
157157
* Constructs a new instance.
158158
*
159-
* @param file The path of the file to open.
160-
* @param bufferSize Size of the sliding buffer.
159+
* @param builder The builder.
161160
* @throws IOException If an I/O error occurs.
162161
*/
163-
private MemoryMappedFileInputStream(final Path file, final int bufferSize) throws IOException {
164-
this.bufferSize = bufferSize;
165-
this.channel = FileChannel.open(file, StandardOpenOption.READ);
162+
private MemoryMappedFileInputStream(final Builder builder) throws IOException {
163+
this.bufferSize = builder.getBufferSize();
164+
this.channel = FileChannel.open(builder.getPath(), StandardOpenOption.READ);
166165
}
167166

168167
@Override

0 commit comments

Comments
 (0)