j++; int l = j - i;
int l = j - i + 1;
    public static SysexMessage[] byteArrayToSysexMessages(byte[] d)	throws InvalidMidiDataException {	ArrayList list = new ArrayList();        for (int i = 0; i < d.length; i++) {	    if ((int) (d[i] & 0xFF) == SysexMessage.SYSTEM_EXCLUSIVE) {		int j;		// let cause exception if there is no END_OF_EXCLUSIVE		for (j = i + 1; (int) (d[j] & 0xff) != ShortMessage.END_OF_EXCLUSIVE; j++)		    ;		// here d[j] is EOX.		j++;		int l = j - i;		byte[] b = new byte[l];		System.arraycopy(d, i, b, 0, l);		SysexMessage m = new SysexMessage();		m.setMessage(b, l);		list.add(m);		i = j;	    }	}	return (SysexMessage[]) list.toArray(new SysexMessage[0]);    }