aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
index b501cb846e..d27bd37666 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
@@ -148,14 +148,31 @@ public class ReadOnlySharedStringsTable extends DefaultHandler implements Shared
}
/**
- * Like POIXMLDocumentPart constructor
- *
* @since POI 3.14-Beta3
*/
public ReadOnlySharedStringsTable(PackagePart part, boolean includePhoneticRuns)
throws IOException, SAXException {
this.includePhoneticRuns = includePhoneticRuns;
- readFrom(part.getInputStream());
+ try (InputStream stream = part.getInputStream()) {
+ readFrom(stream);
+ }
+ }
+
+ /**
+ * @since POI 5.2.0
+ */
+ public ReadOnlySharedStringsTable(InputStream stream)
+ throws IOException, SAXException {
+ this(stream, true);
+ }
+
+ /**
+ * @since POI 5.2.0
+ */
+ public ReadOnlySharedStringsTable(InputStream stream, boolean includePhoneticRuns)
+ throws IOException, SAXException {
+ this.includePhoneticRuns = includePhoneticRuns;
+ readFrom(stream);
}
/**