private MidiEvent createScheduledEvent(byte[] msg,int offset,int count,long timestamp){
  MidiEvent event;
  if (count > POOL_EVENT_SIZE) {
    event=new MidiEvent(msg,offset,count,timestamp);
  }
 else {
    event=(MidiEvent)removeEventfromPool();
    if (event == null) {
      event=new MidiEvent(POOL_EVENT_SIZE);
    }
    System.arraycopy(msg,offset,event.data,0,count);
    event.count=count;
    event.setTimestamp(timestamp);
  }
  return event;
}

private MidiEvent createScheduledEvent ( byte [ ] msg , int offset , int count , long timestamp ) { MidiEvent event ; if ( count > POOL_EVENT_SIZE ) { event = new MidiEvent ( msg , offset , count , timestamp ) ; } else { event = ( MidiEvent ) removeEventfromPool ( ) ; if ( event == null ) { event = new MidiEvent ( POOL_EVENT_SIZE ) ; } System . arraycopy ( msg , offset , event . data , 0 , count ) ; event . count = count ; event . setTimestamp ( timestamp ) ; } return event ; }
create an event that contains the message .
