Helper function to read the state of a single bit in a byte-buffer.
GetBit( buffer, bitno )
Get the state of a single bit in a buffer
buf | Reference to the byte buffer |
bitno | The bit number (0-indexed) |
Returns the state of the bit (1 or 0)
new buffer{80}; new b; // assuming the buffer is filled with data b = GetBit(buffer, 18); // b is the status of the 19th bit in the buffer