-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
The following demonstrates that a large file fails to stream when metadata is also retrieved:
XMLDocumentManager documentManager = client.newXMLDocumentManager();
Transaction transaction = client.openTransaction();
InputStreamHandle handle = new InputStreamHandle();
DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle();
documentManager.writeAs("all_well.xml", new FileHandle(
new File("test-complete/src/test/java/com/marklogic/client/functionaltest/data/all_well.xml")));
documentManager.read("all_well.xml", metadataHandle, handle, transaction);
InputStream stream = handle.get();
while ( stream.read() > -1 ) {}
The last line just loops through reading the InputStream. But this line will fail because the stream is closed.