Data::BitStream::String - A String implementation of Data::BitStream
use Data::BitStream::String; my $stream = Data::BitStream::String->new; $stream->put_gamma($_) for (1 .. 20); $stream->rewind_for_read; my @values = $stream->get_gamma(-1);
An implementation of Data::BitStream. See the documentation for that module for many more examples, and Data::BitStream::Base for the API. This document only describes the unique features of this implementation, which is of limited value to people purely using Data::BitStream.
This implementation is very memory inefficient, as it uses a binary string to hold the data, hence uses one byte internally per bit of data. However it is a useful reference implementation, and since most operations use Perl operations it is quite fast.
A private string holding the data in binary string form.
Retrieves a reference to the private string.
Sets the private string to the empty string ''.
''
These methods have custom implementations.
The following roles are included. Note that Gamma has an inline implementation.
Dana Jacobsen <dana@acm.org>
Copyright 2011-2012 by Dana Jacobsen <dana@acm.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::BitStream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::BitStream
CPAN shell
perl -MCPAN -e shell install Data::BitStream
For more information on module installation, please visit the detailed CPAN module installation guide.