BIT_ARRAY_BYTES
memset(&m_pBitArray[1], 0, min((int)nBytesToWrite + 1, BIT_ARRAY_BYTES - 1));
#define BIT_ARRAY_BITS (BIT_ARRAY_BYTES * 8) // the number of bits in the bit array
if (m_nCurrentBitIndex > (BIT_ARRAY_BYTES - 8))
memset(m_pBitArray, 0, BIT_ARRAY_BYTES);