public static byte[] readData(final URL url) throws IOException {
  try (InputStream input=url.openStream()){
    return readData(input);
  }
 }

public static byte [ ] readData ( final URL url ) throws IOException { try ( InputStream input = url . openStream ( ) ) { return readData ( input ) ; } }
reads all the data from the supplied url into a byte array .
