Exemple #1
0
        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);
        }
Exemple #2
0
 private void Serialize(Stream stream, MidiSysExBuffer buffer)
 {
     StreamHelpers.CopyTo(buffer.Stream, stream, 0);
 }
Exemple #3
0
 private void Serialize(Stream stream, MidiSysExBuffer buffer)
 {
     buffer.Stream.CopyTo(stream, 0);
 }