code: protected void checkBuf (int pointCount, boolean checkMove) {
          if (checkMove && typeSize == 0) {
              throw new IllegalPathStateException("First segment must be a SEG_MOVETO");
          }
          if (typeSize == types.length) {
              byte[] tmp = new byte[typeSize + BUFFER_CAPACITY];
              System.arraycopy(types, 0, tmp, 0, typeSize);
              types = tmp;
          }
          if (pointSize + pointCount > points.length) {
              float[] tmp = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
              System.arraycopy(points, 0, tmp, 0, pointSize);
              points = tmp;
          }
      }
docs: Checks points and types buffer size to add pointCount points. If necessary realloc buffers
  to enlarge size.
  
  @param pointCount the point count to be added in buffer