public StanzaAndType(ByteBuffer stanza, String body) {
		this.stanza = stanza;
		String stanzaStr = new String(stanza.array());
		if(stanzaStr.contains("</message>")){
			type = MESSAGE;
			String aux = new String(stanza.array());
			String bodyStart = "<body>";
			String bodyEnd = "</body>";
			int index1 = body.indexOf(bodyStart);
			int index2 = body.indexOf(bodyEnd);
			if(index1 > 0 && index2 > 0) {
				String oldBody = body.substring(index1 + bodyStart.length(), index2);
				int index3 = aux.indexOf(bodyStart);
				int index4 = aux.indexOf(bodyEnd);
				if(index3 > 0 || index4 > 0) {
					aux = aux.substring(0, index3 + bodyStart.length())  + oldBody + aux.substring(index4);
					ByteBuffer buf = ByteBuffer.allocate(aux.getBytes().length);
					buf.put(aux.getBytes());
					this.stanza = buf;
				}
			}
		}else if(stanzaStr.contains("</presence>")){
			type = PRESENCE;
		}else if(stanzaStr.contains("</iq>")){
			type = IQ;
		}else{
			type = OTHER;
		}
	}