code: protected void _beforeNewSegment(int resizeBy) {
  		// Called for each new segment being added.
  		if (m_bPathStarted) {
  			_initPathStartPoint();// make sure the m_movetoPoint exists and has
  									// right vertex description
  
  			// The new path is started. Need to grow m_parts and m_pathFlags.
  			if (m_paths == null) {
  				m_paths = (AttributeStreamOfInt32) AttributeStreamBase
  						.createIndexStream(2);
  				m_paths.write(0, 0);
  				m_pathFlags = (AttributeStreamOfInt8) AttributeStreamBase
  						.createByteStream(2, (byte) 0);
  			} else {
  				// _ASSERT(m_parts.size() >= 2);
  				m_paths.resize(m_paths.size() + 1, 0);
  				m_pathFlags.resize(m_pathFlags.size() + 1, 0);
  			}
  
  			if (m_bPolygon) {
  				// Mark the path as closed
  				m_pathFlags.write(m_pathFlags.size() - 2,
  						(byte) PathFlags.enumClosed);
  			}
  
  			resizeBy++; // +1 for the StartPath point.
  		}
  
  		int oldcount = m_pointCount;
  		m_paths.write(m_paths.size() - 1, m_pointCount + resizeBy); // The
  																	// NotifyModified
  																	// will
  																	// update
  																	// the
  																	// m_pointCount
  																	// with this
  																	// value.
  		_resizeImpl(oldcount + resizeBy);
  		m_pathFlags.write(m_paths.size() - 1, (byte) 0);
  
  		if (m_bPathStarted) {
  			setPointByVal(oldcount, m_moveToPoint);// setPoint(oldcount,
  													// m_moveToPoint); //finally
  													// set the start point to
  													// the geometry
  			m_bPathStarted = false;
  		}
  	}
docs: Reviewed vs. Native Jan 11, 2011