Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
rhsm
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/rhsm/bitstream.pyc
mò Wx[Uc�����������@���s'���d��k��l�Z�d�e�f�d�„��ƒ��YZ�d�S(���(���s���dequet���GhettoBitStreamc�����������B���s_���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�e�d�„��ƒ�Z�e �d�„��ƒ�Z �e �d�„��ƒ�Z�RS(���sú�� Accepts binary data and makes it available as a stream of bits or one byte at a time. Python does not provide a built-in way to read a stream of bits, or a way to represent a single bit. Thus, this class uses character '0' or '1' to represent the status of each bit. Data is converted into the '0' and '1' characters one byte at a time, since that operation multiplies the size of the data by a factor of 8, and it may not be desirable to inflate all of the data at once. c���������C���s)���t��d�„��|�Dƒ�ƒ�|��_�t��ƒ��|��_�d�S(���sU��� :param data: binary data in a string :type data: str c���������c���s���x�|��]�}�t�|�ƒ�Vq�Wd��S(���N(���t���[outmost-iterable]t���xt���ord(���R���R���(����(����t2���/usr/lib/python2.4/site-packages/rhsm/bitstream.pyt���<generator expression>"���s����N(���t���dequet���datat���selft���bytest���_bit_buffer(���R���R���(����(����R���t���__init__���s�����c���������C���s���|��S(���N(���R���(���R���(����(����R���t���__iter__%���s����c���������C���sf���|��i�pO�y�|��i�ƒ��}�Wn�t�j �o �t�‚�n�X|��i�|�ƒ�}�|��i�i�|�ƒ�n�|��i�i �ƒ��S(���sõ��� converts one byte at a time into a bit representation, waiting until those bits have been consumed before converting another byte :return: next bit in the stream, either '0' or '1' :rtype: string N( ���R���R ���t���pop_bytet���bytet ���IndexErrort ���StopIterationt ���_byte_to_bitst���bitst���extendt���popleft(���R���R���R���(����(����R���t���next(���s����� c���������C���s ���|��i�i�ƒ��S(���s_��� :return: next entire byte in the stream, as an int :rtype: int N(���R���R ���R���(���R���(����(����R���R ���9���s�����c���������C���s8���y�d�i��|�ƒ�SWn �t�j �o�|��i�|�ƒ�Sn�Xd�S(���s´�� Produces a string representation of a byte as a base-2 number. Python versions < 2.6 lack the "bin()" builtin as well as the below "format()" method of strings, so this method falls back to using a home-brew implementation. :param byte: positive int < 256 :type byte: int :return: binary representation of byte as 8-char string :rtype: str s���{0:08b}N(���t���formatR���t���AttributeErrort���clst ���_bin_backport(���R���R���(����(����R���R���@���s �����c���������C���so���g��}�xY�t�d�d�d�ƒ�D]E�}�|��d�|�}�|�d�j�o�|�i�d�ƒ�|�}��q�|�i�d�ƒ�q�Wd�i�|�ƒ�S( ���sK�� In python versions < 2.6, there is no built-in way to produce a string representation of base-2 data. Thus, we have to do it manually. :param byte: positive int < 256 :type byte: int :return: binary representation of byte as 8-char string :rtype: str i���iÿÿÿÿi���i����t���1t���0t����N(���t���charst���ranget���nR���t���yt���appendt���join(���R���R ���R���R���(����(����R���R���S���s���� �� c���������C���s+���|��}�|�i�ƒ��t�d�„��t�|�ƒ�Dƒ�ƒ�S(���s¯�� combine unsigned ints read from a bit stream into one unsigned number, reading data as big-endian :param data: iterable of positive ints, each representing a byte of uint binary data that should be combined such that the right-most byte stays as-is, and then each byte to the left gets left-shifted by 8 * n bits. For example, [1, 2] would give you 258 ((1 << 8) + 2) :type data: iterable of positive ints :return: positive int, composed from input bytes combined as one int :rtype: int c���������c���s&���x�|��]�\�}�}�|�|�d��>Vq�Wd�S(���i���N(���R���R���R���(���R���R���R���(����(����R���R���z���s����N(���R���t���copyt���reverset���sumt ���enumerate(���R���R#���(����(����R���t ���combine_bytesh���s����� (���t���__name__t ���__module__t���__doc__R���R���R���R ���t���classmethodR���t���staticmethodR���R'���(����(����(����R���R�������s��� � N(���t���collectionsR���t���objectR����(���R���R����(����(����R���t���?���s���