File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/io/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import java .io .BufferedReader ;
2121import java .io .FilterInputStream ;
2222import java .io .IOException ;
23- import java .io .InputStream ;
2423import java .io .UncheckedIOException ;
2524
2625import org .apache .commons .io .build .AbstractStreamBuilder ;
@@ -90,11 +89,10 @@ public Builder() {
9089 * @see #getInputStream()
9190 * @see #getUnchecked()
9291 */
93- @ SuppressWarnings ("resource" )
9492 @ Override
9593 public UncheckedFilterInputStream get () {
9694 // This an unchecked class, so this method is as well.
97- return Uncheck .get (() -> new UncheckedFilterInputStream (getInputStream () ));
95+ return Uncheck .get (() -> new UncheckedFilterInputStream (this ));
9896 }
9997
10098 }
@@ -111,11 +109,12 @@ public static Builder builder() {
111109 /**
112110 * Constructs a {@link UncheckedFilterInputStream}.
113111 *
114- * @param inputStream the underlying input stream, or {@code null} if this instance is to be created without an
115- * underlying stream.
112+ * @param builder A builder providing the underlying input stream.
113+ * @throws IOException
116114 */
117- private UncheckedFilterInputStream (final InputStream inputStream ) {
118- super (inputStream );
115+ @ SuppressWarnings ("resource" ) // caller closes
116+ private UncheckedFilterInputStream (final Builder builder ) throws IOException {
117+ super (builder .getInputStream ());
119118 }
120119
121120 /**
You can’t perform that action at this time.
0 commit comments