Skip to content

Cannot stream when retrieving metadata  #783

@sammefford

Description

@sammefford

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions