Skip to content

Commit 513e45e

Browse files
committed
Internal refactoring
1 parent d251f4b commit 513e45e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/output/ProxyOutputStream.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,19 @@ public Builder() {
6868
* @see #getOutputStream()
6969
* @see #getUnchecked()
7070
*/
71-
@SuppressWarnings("resource") // caller closes
7271
@Override
7372
public ProxyOutputStream get() throws IOException {
74-
return new ProxyOutputStream(getOutputStream());
73+
return new ProxyOutputStream(this);
7574
}
7675

7776
}
7877

78+
@SuppressWarnings("resource") // caller closes
79+
ProxyOutputStream(final Builder builder) throws IOException {
80+
// the delegate is stored in a protected superclass variable named 'out'
81+
super(builder.getOutputStream());
82+
}
83+
7984
/**
8085
* Constructs a new ProxyOutputStream.
8186
*

0 commit comments

Comments
 (0)