Skip to content

Commit 16af8f6

Browse files
author
s_zhangziang
committed
Separate two PRs
1 parent bac1716 commit 16af8f6

File tree

4 files changed

+0
-65
lines changed

4 files changed

+0
-65
lines changed

src/main/java/org/apache/xmlbeans/FilterXmlObject.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.util.Calendar;
2929
import java.util.Date;
3030
import java.util.List;
31-
import java.util.zip.ZipOutputStream;
3231

3332
/**
3433
* A FilterXmlObject delegates to some other XmlObject, which it can use as
@@ -200,10 +199,6 @@ public void save(OutputStream os, XmlOptions options) throws IOException {
200199
underlyingXmlObject().save(os, options);
201200
}
202201

203-
public void save(ZipOutputStream zos, XmlOptions options) throws IOException {
204-
underlyingXmlObject().save(zos, options);
205-
}
206-
207202
public void save(Writer w, XmlOptions options) throws IOException {
208203
underlyingXmlObject().save(w, options);
209204
}

src/main/java/org/apache/xmlbeans/XmlTokenSource.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import javax.xml.stream.XMLStreamReader;
2424
import java.io.*;
25-
import java.util.zip.ZipOutputStream;
2625

2726
/**
2827
* Represents a holder of XML that can return an {@link XmlCursor}
@@ -171,14 +170,6 @@ public interface XmlTokenSource {
171170
*/
172171
void save(OutputStream os) throws IOException;
173172

174-
/**
175-
* Writes the XML represented by this source to the given zip output stream.
176-
* This method will save the XML declaration, including encoding information,
177-
* with the XML.
178-
*/
179-
void save(ZipOutputStream os) throws IOException;
180-
181-
182173
/**
183174
* Writes the XML represented by this source to the given output.
184175
* Note that this method does not save the XML declaration, including the encoding information.
@@ -345,13 +336,6 @@ public interface XmlTokenSource {
345336
*/
346337
void save(OutputStream os, XmlOptions options) throws IOException;
347338

348-
/**
349-
* Writes the XML represented by this source to the given zip output stream.
350-
* This method will save the XML declaration, including encoding information,
351-
* with the XML.
352-
*/
353-
void save(ZipOutputStream os, XmlOptions options) throws IOException;
354-
355339
/**
356340
* Writes the XML represented by this source to the given output.
357341
* Note that this method does not save the XML declaration, including the encoding information.

src/main/java/org/apache/xmlbeans/impl/store/Cursor.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.util.Collection;
3838
import java.util.Map;
3939
import java.util.function.Supplier;
40-
import java.util.zip.ZipOutputStream;
4140

4241
public final class Cursor implements XmlCursor, ChangeListener {
4342
static final int ROOT = Cur.ROOT;
@@ -511,10 +510,6 @@ public void _save(OutputStream os) throws IOException {
511510
_save(os, null);
512511
}
513512

514-
public void _save(ZipOutputStream zos) throws IOException {
515-
_save(zos, null);
516-
}
517-
518513
public void _save(Writer w) throws IOException {
519514
_save(w, null);
520515
}
@@ -584,26 +579,6 @@ public void _save(OutputStream os, XmlOptions options) throws IOException {
584579
}
585580
}
586581

587-
public void _save(ZipOutputStream zos, XmlOptions options) throws IOException {
588-
if (zos == null) {
589-
throw new IllegalArgumentException("Null ZipOutputStream specified");
590-
}
591-
592-
try (InputStream is = _newInputStream(options)) {
593-
byte[] bytes = new byte[8192];
594-
595-
for (; ; ) {
596-
int n = is.read(bytes);
597-
598-
if (n < 0) {
599-
break;
600-
}
601-
602-
zos.write(bytes, 0, n);
603-
}
604-
}
605-
}
606-
607582
public void _save(Writer w, XmlOptions options) throws IOException {
608583
if (w == null) {
609584
throw new IllegalArgumentException("Null Writer specified");
@@ -2000,10 +1975,6 @@ public void save(OutputStream os) throws IOException {
20001975
syncWrapIOEx(() -> _save(os));
20011976
}
20021977

2003-
public void save(ZipOutputStream zos) throws IOException {
2004-
syncWrapIOEx(() -> _save(zos));
2005-
}
2006-
20071978
public void save(Writer w) throws IOException {
20081979
syncWrapIOEx(() -> _save(w));
20091980
}
@@ -2036,10 +2007,6 @@ public void save(OutputStream os, XmlOptions options) throws IOException {
20362007
syncWrapIOEx(() -> _save(os, options));
20372008
}
20382009

2039-
public void save(ZipOutputStream zos, XmlOptions options) throws IOException {
2040-
syncWrapIOEx(() -> _save(zos, options));
2041-
}
2042-
20432010
public void save(Writer w, XmlOptions options) throws IOException {
20442011
syncWrapIOEx(() -> _save(w, options));
20452012
}

src/main/java/org/apache/xmlbeans/impl/values/XmlObjectBase.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import java.util.*;
3636
import java.util.function.Function;
3737
import java.util.function.IntFunction;
38-
import java.util.zip.ZipOutputStream;
3938

4039
public abstract class XmlObjectBase implements TypeStoreUser, Serializable, XmlObject, SimpleValue {
4140
public static final short MAJOR_VERSION_NUMBER = (short) 1; // for serialization
@@ -192,12 +191,6 @@ public void save(OutputStream os, XmlOptions options) throws IOException {
192191
}
193192
}
194193

195-
public void save(ZipOutputStream zos, XmlOptions options) throws IOException {
196-
try (XmlCursor cur = newCursorForce()) {
197-
cur.save(zos, makeInnerOptions(options));
198-
}
199-
}
200-
201194
public void save(Writer w, XmlOptions options) throws IOException {
202195
try (XmlCursor cur = newCursorForce()) {
203196
cur.save(w, makeInnerOptions(options));
@@ -216,10 +209,6 @@ public void save(OutputStream os) throws IOException {
216209
save(os, null);
217210
}
218211

219-
public void save(ZipOutputStream zos) throws IOException {
220-
save(zos, null);
221-
}
222-
223212
public void save(Writer w) throws IOException {
224213
save(w, null);
225214
}

0 commit comments

Comments
 (0)