I`m trying to read an image from an URL (with the java package java.net.URL) to a byte[]. \"Everything\" works fine, except that the content isnt being ent
Use commons-io IOUtils.toByteArray(URL):
String url = "http://localhost:8080/images/anImage.jpg"; byte[] fileContent = IOUtils.toByteArray(new URL(url));
Maven dependency:
commons-io commons-io 2.6