Share via

Streaming large files with Document Intelligence JAVA SDK

Meier Alexander 0 Reputation points
2026-02-16T12:09:38.21+00:00

Whilst it is possible to stream large files with the Python SDK (e.g. see https://learn.microsoft.com/en-us/answers/questions/2084651/streaming-large-files-with-document-intelligence-p?source=docs), this does not seem possible in the Java SDK.
In the Java SDK, the DocumentIntelligenceClientImpl only has hard coded "application/json" BodyParams and the AnalyzeDocumentOptions which allow BinaryData as input use a binaryData.toBytes() call which loads all the data into memory.

Is it really NOT POSSIBLE to stream large files with the JAVA SDK for Document Intelligence?

Azure Document Intelligence in Foundry Tools
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-02-16T12:10:19.6133333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The current implementation of the Document Intelligence SDK for Java does not support streaming large files directly. As you mentioned, the DocumentIntelligenceClientImpl uses hard-coded "application/json" BodyParams, and the AnalyzeDocumentOptions allows for input through BinaryData, which requires loading the entire file into memory using binaryData.toBytes(). This means that, unlike the Python SDK, the Java SDK does not provide a mechanism for streaming large files without consuming significant memory resources.

    If streaming is a critical requirement for your application, you may need to consider alternative approaches, such as breaking the files into smaller chunks or using the Python SDK for that specific functionality.


    References:


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.