[bug-67579] add new XmlVisioDocument constructor

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913364 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2023-10-26 18:24:03 +00:00
parent 89ccbec1dd
commit 6e680589de
2 changed files with 17 additions and 3 deletions

View File

@ -49,7 +49,7 @@ public final class PackageHelper {
* @throws IOException If reading data from the stream fails
*/
public static OPCPackage open(InputStream stream) throws IOException {
return open(stream, false);
return open(stream, true);
}
/**

View File

@ -76,8 +76,22 @@ public class XmlVisioDocument extends POIXMLDocument {
load(new XDGFFactory(_document));
}
public XmlVisioDocument(InputStream is) throws IOException {
this(PackageHelper.open(is));
/**
* @param stream InputStream - closed when it is read
* @throws IOException
*/
public XmlVisioDocument(InputStream stream) throws IOException {
this(stream, true);
}
/**
* @param stream InputStream
* @param closeStream Whether to close the InputStream
* @throws IOException
* @since POI 5.2.5
*/
public XmlVisioDocument(InputStream stream, boolean closeStream) throws IOException {
this(PackageHelper.open(stream, closeStream));
}
@Override