public WaspPreset DecodeFlWasp(FstPreset preset) { var packet = _fstDataPacketConverter.Decode(preset.Packets.Single(p => p.Id == "FLdt")); var offset = 73 + packet.PluginData[55]; var buffer = new byte[164]; packet.PluginData.AsSpan(offset, buffer.Length).CopyTo(buffer); return(new WaspPreset { Data = buffer }); }
public FstPreset Read(Stream stream) { var result = new FstPreset { Packets = new List <FstPacket>() }; while (true) { var packet = _fstPacketStreamer.Read(stream); if (packet == null) { break; } result.Packets.Add(packet); } return(result); }
public int Write(Stream stream, FstPreset preset) { return(preset.Packets.Sum(packet => _fstPacketStreamer.Write(stream, packet))); }