public void align() {
      if(endian==BIG_ENDIAN && bitIndex>=0) {
         bitIndex=7;
         byteIndex++;
      }
      else if(endian==LITTLE_ENDIAN && bitIndex<=7) {
         bitIndex=0;
         byteIndex++;
      }
   }