From the course: Parallel and Concurrent Programming with Java 2
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Challenge: Download images in Java - Java Tutorial
From the course: Parallel and Concurrent Programming with Java 2
Challenge: Download images in Java
(electronic music) - [Instructor] For our third and final challenge, your goal will be to design and build a program to concurrently download a collection of image files from the internet and return the total number of bytes. We have 50 images hosted at the URL shown here, which you can use as the target files to download for this challenge. All of the JPG files are numbered sequentially from one to 50. To give you a starting point for this challenge, we've already implemented a sequential version of the image downloader in this example program. The sequential image downloader class has a constructor method on line 14 which takes in an array of integers representing the image numbers to be downloaded. The public download all method on line 19 uses a for loop to iterate through the numbers in that array and passes them, one at a time, to the download image method, which downloads the corresponding image file and then returns the number of bytes it was. The download all method…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Welcome to the challenges39s
-
(Locked)
Challenge: Matrix multiply in Java5m 4s
-
(Locked)
Solution: Matrix multiply in Java6m 20s
-
(Locked)
Challenge: Merge sort in Java4m 34s
-
(Locked)
Solution: Merge sort in Java3m 47s
-
(Locked)
Challenge: Download images in Java2m 34s
-
(Locked)
Solution: Download images in Java4m 3s
-
(Locked)
-