public void Send(MidiSysExBuffer sysExBuffer) { var buffer = this.RetrieveBuffer(); sysExBuffer.Stream.Position = 0; buffer.Position = 0; StreamHelpers.CopyTo(sysExBuffer.Stream, buffer, 0); this.outPort.LongData(buffer); }
public IEnumerable <MidiSysExBuffer> Deserialize(Stream stream) { var buffers = new List <MidiSysExBuffer>(); var temp = new MemoryStream(); while (ScanSysExMarkers(stream, temp)) { var length = (int)temp.Position; var buffer = new MidiSysExBuffer(length); temp.Position = 0; // re-read StreamHelpers.CopyTo(temp, buffer.Stream, length); //temp.CopyTo(buffer.Stream); buffers.Add(buffer); temp = new MemoryStream(); } return(buffers); }
private void Serialize(Stream stream, MidiSysExBuffer buffer) { StreamHelpers.CopyTo(buffer.Stream, stream, 0); }