【发布时间】:2018-07-27 10:07:00
【问题描述】:
我正在尝试将 cmis 文档转换为字节流,以与使用 byte[] 的项目特定请求构造函数同步,从文件类型对象转换是可以的,但转换 cmis 文档是我的工作没有得到。
【问题讨论】:
-
从 CMIS 文档的内容流中获取字节?
标签: apache fileinputstream cmis apache-chemistry
我正在尝试将 cmis 文档转换为字节流,以与使用 byte[] 的项目特定请求构造函数同步,从文件类型对象转换是可以的,但转换 cmis 文档是我的工作没有得到。
【问题讨论】:
标签: apache fileinputstream cmis apache-chemistry
如果您使用的是 Java 9 或更高版本,则可以这样做。
Document doc = ...;
InputStream stream = doc.getContentStream().getStream();
byte[] bytes = null;
try {
bytes = stream.readAllBytes();
}
finally {
stream.close();
}
【讨论】: