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 of the program gets the file located at
Here is some starter code (you will need to find the appropriate
URL url = new URL( "http://www.cs.fiu.edu/~weiss/cop3337/assignments/dict.txt" );
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.
The URL http://www.cs.fiu.edu/~weiss/cop3337/assignments/dict.ser.gz
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.