RFR: 8361286: Allow enabling of background loading for images loaded from an InputStream [v4]
Kevin Rushforth
kcr at openjdk.org
Thu Aug 21 17:50:00 UTC 2025
On Wed, 20 Aug 2025 23:33:16 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:
>> Support background loading of raw input streams
>>
>> - Fixed generics (mix up of two ImageLoader types)
>> - Removed unused code for handling headers, methods, request parameters
>> - Use `long` for progress as streams may exceed 2 GB
>> - Improved documentation of Image regarding background loading
>
> John Hendrikx has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix typo
We need to leave the existing synchronous constructors alone, other than to document that they do not close the input stream (which is what we do in the `Font::loadFont` methods that take an `InputStream`).
As for the new constructors, I think the options are:
1. Keep it as you propose, where the async variant _always_ closes the stream (the rationale being that the caller has transferred ownership of the stream)
2. Change the new constructors to never close the stream; this would be OK as long as we provide an easy way for the caller to know when they should do it
3. Add a Supplier to the constructors (I'm a little fuzzy on the details of this one)
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1875#issuecomment-3211546196
More information about the openjfx-dev
mailing list