I'm writing a simple game using a data driven design in which I read in the images for the various elements of the game. As such I've written a parser to read-in the files, confirm that they're an acceptable image format, and create a new Sprite (class I've written) using the files.
I read in the files using ImageIO.read() as seen in the example below.
toAdd = new Sprite(ImageIO.read(targetFile));
The stack trace for the exception is as follows:
javax.imageio.IIOException: Can't create an ImageInputStream!
at javax.imageio.ImageIO.read(ImageIO.java:1280)
at edu.moravian.utilities.dataParsers.GraphicsDataParser.readInSprites(GraphicsDataParser.java:53)
I've got no idea what's causing this. The application isn't multi-threaded, the images are in the correct directory and are confirmed to exist, and I have the permissions necessary to access the images.
What might I be missing?