/* Function to retrieve the next bit stored in the given bit buffer.  */
bool BitBuffer_GetNextBit(BitBuffer_t *const Buffer)
/* Function to retrieve the next bit stored in the given bit buffer.  */
bool BitBuffer_GetNextBit(BitBuffer_t *const Buffer)
{
	bool Bit = ((*Buffer->Out.CurrentByte & Buffer->Out.ByteMask) != 0);
	*Buffer->Out.CurrentByte &= ~Buffer->Out.ByteMask;
	Buffer->Elements--;
	if (Buffer->Out.ByteMask == (1 << 7))
	{
		if (Buffer->Out.CurrentByte != &Buffer->Data[sizeof(Buffer->Data) - 1])
		  Buffer->Out.CurrentByte++;
		else
		  Buffer->Out.CurrentByte = Buffer->Data;
		Buffer->Out.ByteMask = (1 << 0);
	}
	else
	{
		Buffer->Out.ByteMask <<= 1;
	}
	return Bit;
}