We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f63b1e commit 4c8226aCopy full SHA for 4c8226a
src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
@@ -97,7 +97,7 @@ public Builder() {
97
*/
98
@Override
99
public XmlStreamWriter get() throws IOException {
100
- return new XmlStreamWriter(getOutputStream(), getCharset());
+ return new XmlStreamWriter(this);
101
}
102
103
@@ -124,6 +124,11 @@ public static Builder builder() {
124
125
private Charset charset;
126
127
+ @SuppressWarnings("resource") // caller closes.
128
+ private XmlStreamWriter(final Builder builder) throws IOException {
129
+ this(builder.getOutputStream(), builder.getCharset());
130
+ }
131
+
132
/**
133
* Constructs a new XML stream writer for the specified file
134
* with a default encoding of UTF-8.
0 commit comments