Java Reference
In-Depth Information
To demonstrate downloading to a binary file, this recipe will download an image from the
HTTP recipes site. This image can be seen on the web page at the following URL:
http://www.httprecipes.com/1/3/sea.php
The contents of this page are shown in Figure 3.4.
Figure 3.4: An Image to Download
If you examine the HTML source for this page you will find that the actual image is lo-
cated at the following URL:
http://www.httprecipes.com/1/3/sea.jpg
Now let's examine how to download an image by downloading a binary file. The example
recipe, Recipe 3.4, is shown below in Listing 3.6.
Listing 3.6: Download a Binary File (DownloadBinary.java)
package com.heatonresearch.httprecipes.ch3.recipe4;
Search WWH ::




Custom Search