Class ZipImageLoader
[ Source
| Index
| Back to Nelzan ]
- public class ZipImageLoader
- extends Object
ZipImageLoader - Downloads a compressed Zip file and extracts the
information into an Image Array.
This class is designed to cut dynamic load time by allowing the code
developer to zip a large number of images and laod them as arrays
in their program. Not only does this save download time by only
requesting one file, the contents can be compressed.
-
comp
-
-
myImages
-
-
PATH
-
-
tracker
-
-
url
-
-
ZipImageLoader(String, Applet)
- Creates a new Instance of the class, so it can be used later.
-
addImage(Image[], Image)
- Used to Add an Image to the end of an Array.
-
getImages(String)
- Downloads a zip file and extracts the contents into an images array.
PATH
private static final String PATH
myImages
Image myImages[]
tracker
MediaTracker tracker
url
String url
comp
Applet comp
ZipImageLoader
public ZipImageLoader(String url,
Applet c)
- Creates a new Instance of the class, so it can be used later.
- Parameters:
- url - Base URL, where all the Zip files are kept.
- c - Instance of an Applet, for call backs.
getImages
public Image[] getImages(String file)
- Downloads a zip file and extracts the contents into an images array.
This function also makes use a MediaTracker to make sure the images
download and uses CRC32 to make sure the file integrity is good.
- Parameters:
- file - The file to download and extract
- Returns:
- and Image Array with the contents of the Zip File.
addImage
private Image[] addImage(Image ary[],
Image im)
- Used to Add an Image to the end of an Array.
- Parameters:
- ary - The old array.
- im - New Image to add.
- Returns:
- The new array.
|