diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-12-22 15:01:01 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-12-22 15:01:01 +0000 |
commit | 5df24b681fe0c604389f1fe554c6c356c1d9f28f (patch) | |
tree | 15c621b5a6e9a3251d289dde1a7e741cbd7da4ca /poi-ooxml | |
parent | cf1354dc6c6128d8fd024ee1f57359761cd5fd1f (diff) | |
download | poi-5df24b681fe0c604389f1fe554c6c356c1d9f28f.tar.gz poi-5df24b681fe0c604389f1fe554c6c356c1d9f28f.zip |
extra constructors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896280 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java | 23 |
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); } /** |