if ((char) msgBuffer[f] == '\n' && (char) msgBuffer[f] == '\n')
if ((char) msgBuffer[f] == '\n' && (char) msgBuffer[f+1] == '\n')
	public SIPMessage parseSIPMessage(byte[] msgBuffer) throws ParseException {		bufferPointer = 0;		bodyIsString = false;		Vector retval = new Vector();		currentMessageBytes = msgBuffer;		int s;		// Squeeze out leading CRLF		// Squeeze out the leading nulls (otherwise the parser will crash)		// Bug noted by Will Sullin of Callcast		for (s = bufferPointer; s < msgBuffer.length; s++) {			if ((char) msgBuffer[s] != '\r'				&& (char) msgBuffer[s] != '\n'				&& (char) msgBuffer[s] != '\0')				break;		}		if (s == msgBuffer.length)			return null;		// Find the end of the SIP message.		int f;		for (f = s; f < msgBuffer.length - 4; f++) {			if ((char) msgBuffer[f] == '\r'				&& (char) msgBuffer[f + 1] == '\n'				&& (char) msgBuffer[f + 2] == '\r'				&& (char) msgBuffer[f + 3] == '\n') {				break;			}		}		if (f < msgBuffer.length)			f += 4;		else {			// Could not find CRLFCRLF end of message so look for LFLF			for (f = s; f < msgBuffer.length - 2; f++) {				if ((char) msgBuffer[f] == '\n' && (char) msgBuffer[f] == '\n')					break;			}			if (f < msgBuffer.length)				f += 2;			else				throw new ParseException("Message not terminated", 0);		}		// Encode the body as a UTF-8 string.		String messageString = null;		try {			messageString = new String(msgBuffer, s, f - s, "UTF-8");		} catch (UnsupportedEncodingException ex) {			throw new ParseException("Bad message encoding!", 0);		}		bufferPointer = f;		StringBuffer message = new StringBuffer(messageString);		int length = message.length();		// Get rid of CR to make it uniform for the parser.		for (int k = 0; k < length; k++) {			if (message.charAt(k) == '\r') {				message.deleteCharAt(k);				length--;			}		}		if (Parser.debug) {			for (int k = 0; k < length; k++) {				rawMessage1 = rawMessage1 + "[" + message.charAt(k) + "]";			}		}		// The following can be written more efficiently in a single pass		// but it is somewhat tricky.		java.util.StringTokenizer tokenizer =			new java.util.StringTokenizer(message.toString(), "\n", true);		StringBuffer cooked_message = new StringBuffer();		try {			while (tokenizer.hasMoreElements()) {				String nexttok = tokenizer.nextToken();				// Ignore blank lines with leading spaces or tabs.				if (nexttok.trim().equals(""))					cooked_message.append("\n");				else					cooked_message.append(nexttok);			}		} catch (NoSuchElementException ex) {		}		String message1 = cooked_message.toString();		length = message1.indexOf("\n\n") + 2;		// Handle continuations - look for a space or a tab at the start		// of the line and append it to the previous line.		for (int k = 0; k < length - 1;) {			if (cooked_message.charAt(k) == '\n') {				if (cooked_message.charAt(k + 1) == '\t'					|| cooked_message.charAt(k + 1) == ' ') {					cooked_message.deleteCharAt(k);					cooked_message.deleteCharAt(k);					length--;					length--;					if (k == length)						break;					continue;				}				if (cooked_message.charAt(k + 1) == '\n') {					cooked_message.insert(k, '\n');					length++;					k++;				}			}			k++;		}		cooked_message.append("\n\n");		// Separate the string out into substrings for		// error reporting.		currentMessage = cooked_message.toString();		SIPMessage sipmsg = this.parseMessage(currentMessage);		if (readBody			&& sipmsg.getContentLength() != null			&& sipmsg.getContentLength().getContentLength() != 0) {			this.contentLength = sipmsg.getContentLength().getContentLength();			byte body[] = getBodyAsBytes();			sipmsg.setMessageContent(body);		}		// System.out.println("Parsed = " + sipmsg);		return sipmsg;	}