marklogic - Read and write using DocumentMetadataHandle and InputStreamHandle -
trying read document 1 location , write different location. using documentmetadatahandle metadata , inputstreamhandle read content. write when use same inputstreamhandle used read throwing stream closed exception. same not happening when don't use documentmetadatahandle in read. code below. using java client 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);
if want buffer document in memory writing server, might consider using byteshandle instead of inputstreamhandle.
documentmetadatahandle buffer metadata.
Comments
Post a Comment