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