in reply to Re: BitStream revisited
in thread BitStream revisited
Performance aside for a moment, why don't you think OO is appropriate here ? I happen to think it is, and my proof is that using this BitStream (I use it extensively in a large application) is a pleasure.
As I see it, the BitStream has an internal state - position of the file handle, a current buffer (that is a *must*, as I said, as keeping the whole thing in memory is unpractical, and read()-ing on each access is slow), etc. I simply call $in->get_bits(number) and get my bits. If I want, I call $in->seek_pos(jump, whence) to go where I want, etc... I find that encapsulating this with an object is very convenient.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: BitStream revisited
by tachyon (Chancellor) on Jan 01, 2004 at 11:02 UTC |