Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Mon Oct 8 2001 7:07 pm
Author: Bortz, Andrew S. <abortz@andrew.cmu.edu>
Subject: Re: A call to in.readByte() gives me an error

You either have to put the call in a try/catch block (basically, you are telling the compiler that you can handle the exception) or you declare the function to rethrow the exception (pushing the responsibility on to the caller of your function). You can't change the interface to BitReader because our teachers say you can't.

However, since the function's prototype is defined by the Compressor interface, and that prototype includes "throws IOException", you might as well declare your decompress() to throw IOException and let the caller deal with it.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
A call to in.readByte() gives me an er...      Loving, Benjamin Jameson      Mon Oct 8 2001 5:22 pm       
Re: A call to in.readByte() gives m...      Bortz, Andrew S.      Mon Oct 8 2001 7:07 pm       
Re: A call to in.readByte() gives m...      Lee, Charles C.      Mon Oct 8 2001 7:37 pm       

Back to previous screen