Currently trying to pass an InputSteam
to Java's ImageIO
by providing a URL().openStream()
.
val sourceIO = new URL(fileName).openStream()
val bufferedImage = ImageIO.read(sourceIO)
I am testing around 100 different images. I know each image exists because when I pass the same input steam to a different class, it works just fine. However, ImageIO keeps complaining the stream is null: java.lang.IllegalArgumentException: input == null!
My suspicion is that something is not properly initializing. Any idea how to fix this? Thanks!