Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Tue Oct 9 2001 12:28 am
Author: Bortz, Andrew S. <abortz@andrew.cmu.edu>
Subject: Re: general clarification on FileBitReader/Writer classes

Or you can just use readBits(8).

I don't entirely agree that readByte()'s return type is bad. Since you _can_ use readBits(8) to get a byte value between 0 and 255, there's no point in having a function with a different name that does the same thing. By returning byte, it gives you a different mechanism for dealing with the data.

The signed (as opposed to unsigned) behavior of readByte() wasn't made very clear, however, so it seems everyone has had to learn on their own. Bad call there, but overall I think the BitReader/Writer interfaces are alright. Not perfect by any means, but good enough.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
general clarification on FileBitReader...      Liu, William Y.      Mon Oct 8 2001 10:34 pm       
Re: general clarification on FileBi...      Lee, Charles C.      Mon Oct 8 2001 11:13 pm       
Re: general clarification on Fil...      Cipriani, Jason A.      Mon Oct 8 2001 11:30 pm       
Re: general clarification on ...      Bortz, Andrew S.      Tue Oct 9 2001 12:28 am       
Re: general clarification ...      Cipriani, Jason A.      Wed Oct 10 2001 1:01 am       
Re: general clarificati...      Bortz, Andrew S.      Wed Oct 10 2001 11:04 am       
Re: general clarific...      Cipriani, Jason A.      Wed Oct 10 2001 12:45 pm       
Re: general clarific...      Cipriani, Jason A.      Wed Oct 10 2001 12:50 pm       
Re: general clari...      Cipriani, Jason A.      Wed Oct 10 2001 12:51 pm       

Back to previous screen