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. |
|