Skip to content

Commit 28fad63

Browse files
committed
Internal refactoring
1 parent 513e45e commit 28fad63

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ public Builder() {
9090
* @see AbstractOrigin#getFile()
9191
* @see #getUnchecked()
9292
*/
93-
@SuppressWarnings("resource") // caller closes
9493
@Override
9594
public RandomAccessFileInputStream get() throws IOException {
96-
return new RandomAccessFileInputStream(getRandomAccessFile(), propagateClose);
95+
return new RandomAccessFileInputStream(this);
9796
}
9897

9998
/**
@@ -133,6 +132,11 @@ public static Builder builder() {
133132
private final boolean propagateClose;
134133
private final RandomAccessFile randomAccessFile;
135134

135+
@SuppressWarnings("resource") // caller closes.
136+
private RandomAccessFileInputStream(final Builder builder) throws IOException {
137+
this(builder.getRandomAccessFile(), builder.propagateClose);
138+
}
139+
136140
/**
137141
* Constructs a new instance configured to leave the underlying file open when this stream is closed.
138142
*

0 commit comments

Comments
 (0)