code: private void addPoint(int pos, int flag)
      {
          Point point = new Point();
  
          int len = insertPoints.points.length;
          if (len == 0) {
              insertPoints.points = new Point[FIRSTALLOC];
              len = FIRSTALLOC;
          }
          if (insertPoints.size >= len) { /* no room for new point */
              Point[] savePoints = insertPoints.points;
              insertPoints.points = new Point[len * 2];
              System.arraycopy(savePoints, 0, insertPoints.points, 0, len);
          }
          point.pos = pos;
          point.flag = flag;
          insertPoints.points[insertPoints.size] = point;
          insertPoints.size++;
      }
docs: /*
  param pos:     position where to insert
  param flag:    one of LRM_BEFORE, LRM_AFTER, RLM_BEFORE, RLM_AFTER