public SDPAnnounceParser(String message){
  int start=0;
  String line=null;
  if (message == null)   return;
  sdpMessage=new Vector();
  String sdpAnnounce=message.trim() + "\r\n";
  while (start < sdpAnnounce.length()) {
    int lfPos=sdpAnnounce.indexOf("\n",start);
    int crPos=sdpAnnounce.indexOf("\r",start);
    if (lfPos >= 0 && crPos < 0) {
      line=sdpAnnounce.substring(start,lfPos);
      start=lfPos + 1;
    }
 else     if (lfPos < 0 && crPos >= 0) {
      line=sdpAnnounce.substring(start,crPos);
      start=crPos + 1;
    }
 else     if (lfPos >= 0 && crPos >= 0) {
      if (lfPos > crPos) {
        line=sdpAnnounce.substring(start,crPos);
        if (lfPos == crPos + 1) {
          start=lfPos + 1;
        }
 else {
          start=crPos + 1;
        }
      }
 else {
        line=sdpAnnounce.substring(start,lfPos);
        if (crPos == lfPos + 1) {
          start=crPos + 1;
        }
 else {
          start=lfPos + 1;
        }
      }
    }
 else     if (lfPos < 0 && crPos < 0) {
      break;
    }
    sdpMessage.addElement(line);
  }
}

public SDPAnnounceParser ( String message ) { int start = 0 ; String line = null ; if ( message == null ) return ; sdpMessage = new Vector ( ) ; String sdpAnnounce = message . trim ( ) + "\r\n" ; while ( start < sdpAnnounce . length ( ) ) { int lfPos = sdpAnnounce . indexOf ( "\n" , start ) ; int crPos = sdpAnnounce . indexOf ( "\r" , start ) ; if ( lfPos >= 0 && crPos < 0 ) { line = sdpAnnounce . substring ( start , lfPos ) ; start = lfPos + 1 ; } else if ( lfPos < 0 && crPos >= 0 ) { line = sdpAnnounce . substring ( start , crPos ) ; start = crPos + 1 ; } else if ( lfPos >= 0 && crPos >= 0 ) { if ( lfPos > crPos ) { line = sdpAnnounce . substring ( start , crPos ) ; if ( lfPos == crPos + 1 ) { start = lfPos + 1 ; } else { start = crPos + 1 ; } } else { line = sdpAnnounce . substring ( start , lfPos ) ; if ( crPos == lfPos + 1 ) { start = crPos + 1 ; } else { start = lfPos + 1 ; } } } else if ( lfPos < 0 && crPos < 0 ) { break ; } sdpMessage . addElement ( line ) ; } }
create a new sdpannounceparser .
