Marklogic 使用DocumentMetadataHandle和InputStreamHandle进行读写

Marklogic 使用DocumentMetadataHandle和InputStreamHandle进行读写,marklogic,Marklogic,尝试从一个位置读取文档并写入另一个位置。使用DocumentMetadataHandle获取元数据,使用InputStreamHandle读取内容。当我使用与我用于引发流关闭异常的读取相同的InputStreamHandle时,用于写入。当我在read中不使用DocumentMetadataHandle时,情况就不一样了。下面是代码a。使用Java客户端API 3.0.7 XMLDocumentManager documentManager = client.newXMLDocumentMana

尝试从一个位置读取文档并写入另一个位置。使用DocumentMetadataHandle获取元数据,使用InputStreamHandle读取内容。当我使用与我用于引发流关闭异常的读取相同的InputStreamHandle时,用于写入。当我在read中不使用DocumentMetadataHandle时,情况就不一样了。下面是代码a。使用Java客户端API 3.0.7

XMLDocumentManager documentManager = client.newXMLDocumentManager();
Transaction transaction = client.openTransaction();
InputStreamHandle handle = new InputStreamHandle();
DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle();
documentManager.read(uri, metadataHandle, handle,transaction);
documentManager.write(newUri, metadataHandle, handle, transaction);

如果您想在内存中缓冲文档以写入服务器,您可以考虑使用ByTeSt句柄而不是输入流句柄。
DocumentMetadataHandle会缓冲元数据。

谢谢,Siju,我相信你发现了一个bug。Erik的解决方案应该为您提供一个解决方案。然而,我已经在github中登录了这个,所以我们可以解决它:Erik的解决方案?下面ehennum的帖子,建议使用BytesHandle。