public static byte [ ] toByteArray ( URL url ) throws IOException { try ( InputStream inputStream = url . openStream ( ) ) { return ByteStreams . toByteArray ( inputStream ) ; } }
Reads all bytes from a URL into a byte array .