public void sendMessage(final int receiverHandle,
final String jsonMessageStr,
final long timeStamp)
throws InvalidMidiDataException, JSONException
{
final Receiver receiver = resolveReceiverHandle(receiverHandle);
final JSONObject json = new JSONObject(jsonMessageStr);
final JSONArray jsonData = json.getJSONArray("data");
final int length = jsonData.length();
final byte[] data = new byte[length];
for (int i = 0; i < length; i++)
data[i] = (byte) (jsonData.getInt(i) & 0xff);
final RawMidiMessage message = new RawMidiMessage(data);
receiver.send(message, timeStamp);
}