Class PackageHelper

java.lang.Object
org.apache.poi.ooxml.util.PackageHelper

public final class PackageHelper extends Object
Provides handy methods to work with OOXML packages
  • Constructor Details

    • PackageHelper

      public PackageHelper()
  • Method Details

    • open

      public static OPCPackage open(InputStream stream) throws IOException
      Parameters:
      stream - The InputStream to read from - which is closed when it is read
      Returns:
      OPCPackage
      Throws:
      IOException - If reading data from the stream fails
      POIXMLException - If the stream is not a valid OPC package
    • open

      public static OPCPackage open(InputStream stream, boolean closeStream) throws IOException
      Parameters:
      stream - The InputStream to read from
      closeStream - whether to close the stream
      Returns:
      OPCPackage
      Throws:
      IOException - If reading data from the stream fails
      POIXMLException - If the stream is not a valid OPC package
      Since:
      5.2.0