@Nullable
	public static Image convertIcoToFxImage(@Nonnull byte[] ico) throws IOException {
		ImageReader reader = null;

		// This relies on "TwelveMonkeys" being on the classpath to register an image reader
		// instance for ICO support.
		try (ImageInputStream iis = ImageIO.createImageInputStream(new ByteArrayInputStream(ico))) {
			Iterator<ImageReader> readers = ImageIO.getImageReaders(iis);
			if (!readers.hasNext())
				throw new IOException("No supported readers for image type");

			reader = readers.next();
			reader.setInput(iis);
			int count = reader.getNumImages(true);

			// Get the image with the highest resolution.
			Image result = null;
			for (int i = 0; i < count; i++) {
				BufferedImage img = reader.read(i, null);
				if (result == null || result.getWidth() < img.getWidth())
					result = convertToFxImage(img);
			}
			return result;
		} finally {
			if (reader != null) {
				reader.dispose();
			}
		}
	}
Converts an ICO file into a JavaFX image.

@param ico
		Raw bytes of ICO image.

@return Highest resolution version of the icon image.

@throws IOException
		When the image file cannot be read.
recaf-ui/src/main/java/software/coley/recaf/util/Icons.java