code: public static byte[] toByteArray(URL url) throws IOException {
          try (InputStream inputStream = url.openStream()) {
              return ByteStreams.toByteArray(inputStream);
          }
      }
docs: Reads all bytes from a URL into a byte array.
  
  @param url the URL to read from
  @return a byte array containing all the bytes from the URL
  @throws IOException if an I/O error occurs