Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Mon Oct 8 2001 11:30 pm
Author: Cipriani, Jason A. <jac4@andrew.cmu.edu>
Subject: Re: general clarification on FileBitReader/Writer classes

well, readByte() almost gets the ascii character value...

unfortunately it does not, due to a very poor choice of having the return value be "byte" (-128 to 127, or something like that).

whoever wrote that, bad call on using "byte".

the workaround is:

byte theByte = input.readByte();
if (theByte < 0) theByte += 256;


jason
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