}
int smafDataLength = 0;
Track[] tracks = sequence.getTracks();
for (int t = 0; t < tracks.length; t++) {
TrackMessage track = new TrackMessage(t, tracks[t]);
smafDataLength += track.getDataLength();
}
DataOutputStream dos = new DataOutputStream(out);
//
dos.writeBytes(TYPE);
dos.writeInt(smafDataLength);
// 3. tracks
for (int t = 0; t < tracks.length; t++) {
TrackMessage track = new TrackMessage(t, tracks[t]);
track.writeTo(out);
}
out.flush(); // TODO ����H
}