code: private static void addFormatInfo(byte[] grid, int size, EccLevel ecc_level, int pattern) {
  
          int format = pattern;
          int seq;
          int i;
  
          switch (ecc_level) {
              case L:
                  format += 0x08;
                  break;
              case Q:
                  format += 0x18;
                  break;
              case H:
                  format += 0x10;
                  break;
          }
  
          seq = QR_ANNEX_C[format];
  
          for (i = 0; i < 6; i++) {
              grid[(i * size) + 8] += (seq >> i) & 0x01;
          }
  
          for (i = 0; i < 8; i++) {
              grid[(8 * size) + (size - i - 1)] += (seq >> i) & 0x01;
          }
  
          for (i = 0; i < 6; i++) {
              grid[(8 * size) + (5 - i)] += (seq >> (i + 9)) & 0x01;
          }
  
          for (i = 0; i < 7; i++) {
              grid[(((size - 7) + i) * size) + 8] += (seq >> (i + 8)) & 0x01;
          }
  
          grid[(7 * size) + 8] += (seq >> 6) & 0x01;
          grid[(8 * size) + 8] += (seq >> 7) & 0x01;
          grid[(8 * size) + 7] += (seq >> 8) & 0x01;
      }
docs: /* Adds format information to grid.