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

Andy Goryachev angorya at openjdk.org
Mon Aug 18 20:05:06 UTC 2025


On Mon, 18 Aug 2025 09:35:23 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

modules/javafx.graphics/src/main/java/javafx/scene/image/Image.java line 743:

> 741:      * @throws NullPointerException if input stream is null
> 742:      */
> 743:     public Image(@NamedArg("is") InputStream is, @NamedArg("backgroundLoading") boolean backgroundLoading) {

suggestion: swap the arguments to avoid explicit typecasting in the case of `(null, boolean)`

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1875#discussion_r2283332179


More information about the openjfx-dev mailing list