\Zxing\CommonBitSource

<p>This provides an easy abstraction to read bits at a time from a sequence of bytes, where the number of bits read is not often a multiple of 8.</p>

This class is thread-safe but not reentrant -- unless the caller modifies the bytes array it passed in, in which case all bets are off.

Summary

Methods
Properties
Constants
__construct()
getBitOffset()
getByteOffset()
readBits()
available()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$bytes
$byteOffset
$bitOffset
N/A

Properties

$bytes

$bytes

$byteOffset

$byteOffset

$bitOffset

$bitOffset

Methods

__construct()

__construct(mixed  $bytes) : mixed

Parameters

mixed $bytes

Returns

mixed —

getBitOffset()

getBitOffset() : \Zxing\Common\index

Returns

\Zxing\Common\index —

of next bit in current byte which would be read by the next call to {@link #readBits(int)}.

getByteOffset()

getByteOffset() : \Zxing\Common\index

Returns

\Zxing\Common\index —

of next byte in input byte array which would be read by the next call to {@link #readBits(int)}.

readBits()

readBits(mixed  $numBits) : int

Parameters

mixed $numBits

Throws

\Zxing\Common\InvalidArgumentException

if numBits isn't in [1,32] or more than is available

Returns

int —

representing the bits read. The bits will appear as the least-significant bits of the int

available()

available() : \Zxing\Common\number

Returns

\Zxing\Common\number —

of bits that can be read successfully