bits->bytes[0]=bits->bytes[max_len];
if (bits->bitPtr>0) bits->bytes[0]=bits->bytes[max_len]; else bits->bytes[0]=0; for (i=1;i<((bits->nbBits)>>3)+1;i++) bits->bytes[i]=0;
int frame_bits_write_whole_bytes(FrameBits *bits, char *bytes, int max_len){   int i;   if (max_len > ((bits->nbBits)>>3))      max_len = ((bits->nbBits)>>3);   for (i=0;i<max_len;i++)      bytes[i]=bits->bytes[i];   bits->bytes[0]=bits->bytes[max_len];   bits->bytePtr=0;   bits->nbBits-=((bits->nbBits)>>3)<<3;   return max_len;}