本文整理汇总了Java中com.sun.star.io.XInputStream类的典型用法代码示例。如果您正苦于以下问题:Java XInputStream类的具体用法?Java XInputStream怎么用?Java XInputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XInputStream类属于com.sun.star.io包,在下文中一共展示了XInputStream类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadDocument
import com.sun.star.io.XInputStream; //导入依赖的package包/类
/**
* Loads document on the basis of the submitted XInputStream implementation.
*
* @param serviceProvider the service provider to be used
* @param xInputStream OpenOffice.org XInputStream inplementation
* @param properties properties for OpenOffice.org
*
* @return loaded Document
*
* @throws Exception if an OpenOffice.org communication error occurs
* @throws IOException if document can not be found
*/
public static IDocument loadDocument(IServiceProvider serviceProvider, XInputStream xInputStream,
PropertyValue[] properties) throws Exception, IOException {
if (properties == null) {
properties = new PropertyValue[0];
}
PropertyValue[] newProperties = new PropertyValue[properties.length + 1];
for (int i = 0; i < properties.length; i++) {
newProperties[i] = properties[i];
}
newProperties[properties.length] = new PropertyValue();
newProperties[properties.length].Name = "InputStream";
newProperties[properties.length].Value = xInputStream;
Object oDesktop = serviceProvider.createServiceWithContext("com.sun.star.frame.Desktop");
XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class,
oDesktop);
return loadDocument(serviceProvider,
xComponentLoader,
"private:stream",
"_blank",
0,
newProperties);
}
开发者ID:LibreOffice,项目名称:noa-libre,代码行数:36,代码来源:DocumentLoader.java
示例2: loadXComponent
import com.sun.star.io.XInputStream; //导入依赖的package包/类
public XComponent loadXComponent(XInputStream inputStream) throws com.sun.star.lang.IllegalArgumentException, IOException {
XComponentLoader xComponentLoader = getXComponentLoader();
PropertyValue[] props = new PropertyValue[2];
props[0] = new PropertyValue();
props[1] = new PropertyValue();
props[0].Name = "InputStream";
props[0].Value = inputStream;
props[1].Name = "Hidden";
props[1].Value = true;
return xComponentLoader.loadComponentFromURL("private:stream", "_blank", 0, props);
}
开发者ID:cuba-platform,项目名称:yarg,代码行数:13,代码来源:OfficeResourceProvider.java
示例3: getXInputStream
import com.sun.star.io.XInputStream; //导入依赖的package包/类
public XInputStream getXInputStream(ReportTemplate reportTemplate) {
try {
return new OfficeInputStream(IOUtils.toByteArray(reportTemplate.getDocumentContent()));
} catch (java.io.IOException e) {
throw new OpenOfficeException("An error occurred while converting template to XInputStream", e);
}
}
开发者ID:cuba-platform,项目名称:yarg,代码行数:8,代码来源:OfficeResourceProvider.java
注:本文中的com.sun.star.io.XInputStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论