Assignment #3

This assignment asks you to do some simple I/O. You will read a file that contains an unknown number of words into an array of String. Print out the exact number of words read. The file is contained on the Internet. There are two versions of the assignment. Do both.

Version #1

Version #1 of the program gets the file located at Here is some starter code (you will need to find the appropriate import directives.
URL url = new URL( "" );
URLConnection conn = url.openConnection( );
InputStream is = conn.getInputStream( );
Once you have the InputStream you will need to wrap inside a InputStreamReader and then a BufferedReader to read a line at a time. Then you can use ArrayList to store the strings.

Version #2

The URL stores a String[] in compressed gzip form. Open up the URL, wrap inside a BufferedInputStream, then a GZIPInputStream, and then a ObjectInputStream, and call readObject. You will get the entire String array in a single read.