AllyClark has asked for the wisdom of the Perl Monks concerning the following question:
sub huff_decode ( my $tree =shift; my $get_bit =shift; my $put_stream =shift; my $cur_node = $tree; my $cur_bit; while( defined(cur_bit = &$get_bit ) ) { $cur_code = $cur_bit, $cur_node->right : $cur_node->left; unless( $cur_node->left ) { &$put_stream( $cur_node->value ); $cur_node = $tree; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting Stream of bits back into Stream of Characters it Encodes
by belden (Friar) on Jun 10, 2002 at 18:59 UTC | |
|
(ichi) Re: Converting Stream of bits back into Stream of Characters it Encodes
by ichimunki (Priest) on Jun 10, 2002 at 19:49 UTC | |
|
Re: Converting Stream of bits back into Stream of Characters it Encodes
by stajich (Chaplain) on Jun 10, 2002 at 19:09 UTC | |
|
Re: Converting Stream of bits back into Stream of Characters it Encodes
by kal (Hermit) on Jun 10, 2002 at 18:57 UTC | |
by kal (Hermit) on Jun 10, 2002 at 19:05 UTC | |
|
Re: Converting Stream of bits back into Stream of Characters it Encodes
by Fastolfe (Vicar) on Jun 10, 2002 at 22:38 UTC |