Sending / recieving sysex on mac


I’m having trouble using the midi input callbacks and midioutput class to send and receive large sysex messages (upwards of 2048 bytes).

I understand the OS code is different under the hood, but the interfaces behave very differently and has caused me some confusion. On PC handleIncomingMidiMessage behaves as expected and I get blocks of data (eg 256 bytes) at the intervals I expect them, and this also makes it easy to monitor the progress. On OS X, neither of the callback interface methods are called until it finds the terminating byte (apparently) then dumps the whole thing to the handler with missing bytes. Is there someway to get this to behave the same as on PC so I can inspect the data myself?

As far as sending goes, I couldn’t find any decent examples so I gave up on sendBlockOfMessages and created my own thread subclass which probably does the same thing (send blocks of data at specific intervals), again, works flawlessly on PC and allows me to monitor the progress from another thread. Unfortunately this doesn’t seem to work on Mac as the messages come out garbled on the other end. So I either need to look at sendBlockOfMessages again, or I need to start digging around the OS specific code.

Any suggestions?