Skip to content

Commit

Permalink
Separate two PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
s_zhangziang committed Jun 24, 2024
1 parent bac1716 commit 16af8f6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 65 deletions.
5 changes: 0 additions & 5 deletions src/main/java/org/apache/xmlbeans/FilterXmlObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.zip.ZipOutputStream;

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

public void save(ZipOutputStream zos, XmlOptions options) throws IOException {
underlyingXmlObject().save(zos, options);
}

public void save(Writer w, XmlOptions options) throws IOException {
underlyingXmlObject().save(w, options);
}
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/org/apache/xmlbeans/XmlTokenSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import javax.xml.stream.XMLStreamReader;
import java.io.*;
import java.util.zip.ZipOutputStream;

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

/**
* Writes the XML represented by this source to the given zip output stream.
* This method will save the XML declaration, including encoding information,
* with the XML.
*/
void save(ZipOutputStream os) throws IOException;


/**
* Writes the XML represented by this source to the given output.
* Note that this method does not save the XML declaration, including the encoding information.
Expand Down Expand Up @@ -345,13 +336,6 @@ public interface XmlTokenSource {
*/
void save(OutputStream os, XmlOptions options) throws IOException;

/**
* Writes the XML represented by this source to the given zip output stream.
* This method will save the XML declaration, including encoding information,
* with the XML.
*/
void save(ZipOutputStream os, XmlOptions options) throws IOException;

/**
* Writes the XML represented by this source to the given output.
* Note that this method does not save the XML declaration, including the encoding information.
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/org/apache/xmlbeans/impl/store/Cursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.util.Collection;
import java.util.Map;
import java.util.function.Supplier;
import java.util.zip.ZipOutputStream;

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

public void _save(ZipOutputStream zos) throws IOException {
_save(zos, null);
}

public void _save(Writer w) throws IOException {
_save(w, null);
}
Expand Down Expand Up @@ -584,26 +579,6 @@ public void _save(OutputStream os, XmlOptions options) throws IOException {
}
}

public void _save(ZipOutputStream zos, XmlOptions options) throws IOException {
if (zos == null) {
throw new IllegalArgumentException("Null ZipOutputStream specified");
}

try (InputStream is = _newInputStream(options)) {
byte[] bytes = new byte[8192];

for (; ; ) {
int n = is.read(bytes);

if (n < 0) {
break;
}

zos.write(bytes, 0, n);
}
}
}

public void _save(Writer w, XmlOptions options) throws IOException {
if (w == null) {
throw new IllegalArgumentException("Null Writer specified");
Expand Down Expand Up @@ -2000,10 +1975,6 @@ public void save(OutputStream os) throws IOException {
syncWrapIOEx(() -> _save(os));
}

public void save(ZipOutputStream zos) throws IOException {
syncWrapIOEx(() -> _save(zos));
}

public void save(Writer w) throws IOException {
syncWrapIOEx(() -> _save(w));
}
Expand Down Expand Up @@ -2036,10 +2007,6 @@ public void save(OutputStream os, XmlOptions options) throws IOException {
syncWrapIOEx(() -> _save(os, options));
}

public void save(ZipOutputStream zos, XmlOptions options) throws IOException {
syncWrapIOEx(() -> _save(zos, options));
}

public void save(Writer w, XmlOptions options) throws IOException {
syncWrapIOEx(() -> _save(w, options));
}
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/org/apache/xmlbeans/impl/values/XmlObjectBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.*;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.zip.ZipOutputStream;

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

public void save(ZipOutputStream zos, XmlOptions options) throws IOException {
try (XmlCursor cur = newCursorForce()) {
cur.save(zos, makeInnerOptions(options));
}
}

public void save(Writer w, XmlOptions options) throws IOException {
try (XmlCursor cur = newCursorForce()) {
cur.save(w, makeInnerOptions(options));
Expand All @@ -216,10 +209,6 @@ public void save(OutputStream os) throws IOException {
save(os, null);
}

public void save(ZipOutputStream zos) throws IOException {
save(zos, null);
}

public void save(Writer w) throws IOException {
save(w, null);
}
Expand Down

0 comments on commit 16af8f6

Please sign in to comment.