public byte[] toByteArray(String url) {
        URLConnection conn = null;
        try {
            conn = new URL(url).openConnection();
            conn.setConnectTimeout(HTTP_TIMEOUT);
            conn.setReadTimeout(HTTP_TIMEOUT);
            return IOUtils.toByteArray(conn);
        } catch (Exception ex) {
            return ArrayUtils.EMPTY_BYTE_ARRAY;
        } finally {
            IOUtils.close(conn);
        }
    }
toByteArray

@param url url
@return byte[]
src/main/java/com/tuituidan/openhub/util/HttpUtils.java