Im hoping someone could help me understand the purpose of a few lines of this code so I can better utilize Java for zip files...
I have made some comments and hope for your feedback on those comments... thank you

[/CODE]import java.util.*;
import java.io.*;
import java.util.zip.*;

public class Grading {

public static final void main(String[] args) {
//Enumaration? This is sort of like an Iterator?
Enumeration entries;
//Create a ZipFile object
ZipFile zipFile;
//Command line processing
if(args.length != 1) {
System.err.println("Usage: Unzip zipfile");
return;
}

try {
zipFile = new ZipFile(args[0]);

//This gets the "files" or "directories" in the zip, puts it in the entries enumerator
entries = zipFile.entries();

//Loop while there are still files in zip
while(entries.hasMoreElements()) {
//ZipEntry is a file/folder ???
ZipEntry entry = (ZipEntry)entries.nextElement();
//Check if it is a directory
if(entry.isDirectory()) {
//Why use System.err.println() ???? We have only been taught to use System.out.println()
System.err.println("Extracting directory: " + entry.getName());
//Create a new File object, with name of the folder_name from the zip file, and make a directory with that name
(new File(entry.getName())).mkdir();
//It was a folder so skip the next part and start at top of loop
continue;
}

System.err.println("Extracting file: " + entry.getName());
//Call to copyInputStream method ... zipFile.getInputStream() ???? this is what, gets the bits of the file to output later?
copyInputStream(zipFile.getInputStream(entry),
//new BufferedOutputStream??? , new FileOutPutStream() this is what, put the bits out to file of entry.getName()
new BufferedOutputStream(new FileOutputStream(entry.getName())));
}
//Close zip file
zipFile.close();
} catch (IOException ioe) {
System.err.println("Unhandled exception:");
ioe.printStackTrace();
return;
}
}

public static final void copyInputStream(InputStream in, OutputStream out) throws IOException
{
//Im not sure the purpose of having a buffer? i assume it takes in that amt of data from the input stream but why?
byte[] buffer = new byte[1024];
int len;
//Loop - not quite sure what this is doing, in.read(buffer) i believe would read that amt of data, >=0 stop at EOF????
while((len = in.read(buffer)) >= 0)
//Write the output to the new file
out.write(buffer, 0, len);

//Close input/output streams
in.close();
out.close();
}


}//end class
[CODE]