Code:
#include <iostream> using namespace std; void getBitsFromStream( const char *const pData , const int offset, const int length , int *const value) { int tempOffset = offset; const char *pTempData = &pData[tempOffset/8]; bool bitValue=0 ; char bitMaskValue[] = {128 ,0x40 ,0x20 , 0x10 , 0x8 , 0x4 , 0x2 , 0x1}; int tempValue; int tempLength = length-1;
Leave a comment: