Skip to content

Commit 4c8226a

Browse files
committed
Internal refactoring
1 parent 5f63b1e commit 4c8226a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Builder() {
9797
*/
9898
@Override
9999
public XmlStreamWriter get() throws IOException {
100-
return new XmlStreamWriter(getOutputStream(), getCharset());
100+
return new XmlStreamWriter(this);
101101
}
102102

103103
}
@@ -124,6 +124,11 @@ public static Builder builder() {
124124

125125
private Charset charset;
126126

127+
@SuppressWarnings("resource") // caller closes.
128+
private XmlStreamWriter(final Builder builder) throws IOException {
129+
this(builder.getOutputStream(), builder.getCharset());
130+
}
131+
127132
/**
128133
* Constructs a new XML stream writer for the specified file
129134
* with a default encoding of UTF-8.

0 commit comments

Comments
 (0)