Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Thu Oct 11 2001 9:49 pm
Author: Chen, Richard <richardc@andrew.cmu.edu>
Subject: Re: EOF?

To somewhat add onto this question, I have:
try {
byte b_temp=in.readByte();
//all code necessary to build the code table
} catch(Exception e){}
in Huffman.java, but how do I loop that using either a while(/*something*/) or for(/*something*/) so that while there are bytes to read, execute the loop body?

A.k.a. I don't know what methods/etc. to use to forumulate the condition by which I continue to do in.readBytes().

I can't just loop infinitely and hope a thrown error will end the loop, either.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
EOF?      Dozzi, Giancarlo      Mon Oct 8 2001 11:28 pm       
Re: EOF?      Dozzi, Giancarlo      Mon Oct 8 2001 11:30 pm       
Re: EOF?      Cipriani, Jason A.      Mon Oct 8 2001 11:32 pm       
Re: EOF?      Dozzi, Giancarlo      Tue Oct 9 2001 10:56 am       
Re: EOF?      Chen, Richard      Thu Oct 11 2001 9:49 pm       
Re: EOF?      Bortz, Andrew S.      Thu Oct 11 2001 10:01 pm       
EOF and /211hw/hw4/textfiles/...      Chen, Richard      Fri Oct 12 2001 2:57 pm       

Back to previous screen