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 temp.CopyTo(buffer.Stream, length); buffers.Add(buffer); temp = new MemoryStream(); } return(buffers); }
private void Serialize(Stream stream, MidiSysExBuffer buffer) { StreamHelpers.CopyTo(buffer.Stream, stream, 0); }
private void Serialize(Stream stream, MidiSysExBuffer buffer) { buffer.Stream.CopyTo(stream, 0); }