]> source.dussan.org Git - poi.git/commitdiff
extra constructors
authorPJ Fanning <fanningpj@apache.org>
Wed, 22 Dec 2021 15:01:01 +0000 (15:01 +0000)
committerPJ Fanning <fanningpj@apache.org>
Wed, 22 Dec 2021 15:01:01 +0000 (15:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896280 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java

index b501cb846eb3b9810d585848bdc192150367b7e8..d27bd37666cc39a4cd0e1639e739d72db161a334 100644 (file)
@@ -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);
     }
 
     /**