In the project resource files, I have a default image default_image.png. I need to go to him and translate it into an array of bytes.
Image image = new Image("/icons/default_image.png");
URL defaultImageFile = this.getClass().getResource("/icons/default_image.png");
byte[] array = Files.readAllBytes(Paths.get(defaultImageFile.getPath()));
I can take it to the URL as an image, but I can not as a file. How can I refer to this file as an image by URL?