RFR: 8361286: Allow enabling of background loading for images loaded from an InputStream [v4]

John Hendrikx jhendrikx at openjdk.org
Fri Aug 22 10:44: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

Thanks for all the input.  I think there are now two ways to proceed:

1. Leave it as is, including the new `backgroundLoading` variants for `InputStream`, but document clearly for both the old and new constructors when the stream will be closed (ie. only when `backgroundLoading` is `true` we will close the stream).

2. Don't add these new constructors, but add a more obvious variant with `Supplier<InputStream>`, where the ownership is more clear, with the caller of the supplier owning the stream created.

I get the impression the consensus leans towards option 1.  I don't see a direct compelling need for the `Supplier` variant, although I'm happy to provide an implementation if option 2 is favored.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1875#issuecomment-3213920531


More information about the openjfx-dev mailing list