public static byte[] toByteArray(URLConnection urlConn) throws IOException {
        InputStream inputStream = urlConn.getInputStream();
        try {
            return IOUtils.toByteArray(inputStream);
        } finally {
            inputStream.close();
        }
    }
public static byte[] toByteArray(URLConnection urlConn) throws IOException {
        InputStream inputStream = urlConn.getInputStream();
        try {
            return IOUtils.toByteArray(inputStream);
        } finally {
            inputStream.close();
        }
    }
public static byte [ ] toByteArray ( URLConnection urlConn ) throws IOException { InputStream inputStream = urlConn . getInputStream ( ) ; try { return IOUtils . toByteArray ( inputStream ) ; } finally { inputStream . close ( ) ; } }
Get the contents of a <code>URLConnection</code> as a <code>byte[]</code>.

@param urlConn the <code>URLConnection</code> to read
@return the requested byte array
@throws NullPointerException if the urlConn is null
@throws IOException          if an I/O exception occurs
@since 2.4
Get the contents of a <code > URLConnection< / code > as a <code > byte [] < / code > .