private void mergeDRINode(Node node) throws IIOInvalidTreeException {
  DRIMarkerSegment dri=(DRIMarkerSegment)findMarkerSegment(DRIMarkerSegment.class,true);
  if (dri != null) {
    dri.updateFromNativeNode(node,false);
  }
 else {
    DRIMarkerSegment newGuy=new DRIMarkerSegment(node);
    int firstSOF=findMarkerSegmentPosition(SOFMarkerSegment.class,true);
    int firstSOS=findMarkerSegmentPosition(SOSMarkerSegment.class,true);
    if (firstSOF != -1) {
      markerSequence.add(firstSOF,newGuy);
    }
 else     if (firstSOS != -1) {
      markerSequence.add(firstSOS,newGuy);
    }
 else {
      markerSequence.add(newGuy);
    }
  }
}

private void mergeDRINode ( Node node ) throws IIOInvalidTreeException { DRIMarkerSegment dri = ( DRIMarkerSegment ) findMarkerSegment ( DRIMarkerSegment . class , true ) ; if ( dri != null ) { dri . updateFromNativeNode ( node , false ) ; } else { DRIMarkerSegment newGuy = new DRIMarkerSegment ( node ) ; int firstSOF = findMarkerSegmentPosition ( SOFMarkerSegment . class , true ) ; int firstSOS = findMarkerSegmentPosition ( SOSMarkerSegment . class , true ) ; if ( firstSOF != - 1 ) { markerSequence . add ( firstSOF , newGuy ) ; } else if ( firstSOS != - 1 ) { markerSequence . add ( firstSOS , newGuy ) ; } else { markerSequence . add ( newGuy ) ; } } }
merge the given dri node into the marker sequence . if there already exists a dri marker segment , the restart interval value is updated . if there is no dri segment , then a new one is created and added as follows : if there is an sof segment , the new dri segment is inserted before it . if there is no sof segment , the new dri segment is inserted before the first sos segment , if there is one . if there is no sos segment , the new dri segment is added to the end of the sequence .
