/** * @return a serialized version of the current SessionRecord. */ public byte[] serialize() { List <SessionStructure> previousStructures = new List <SessionStructure>(); foreach (SessionState previousState in previousStates) { previousStructures.Add(previousState.getStructure()); } RecordStructure record = RecordStructure.CreateBuilder() .SetCurrentSession(sessionState.getStructure()) .AddRangePreviousSessions(previousStructures) .Build(); return(record.ToByteArray()); }
/// <returns> /// Returns a serialized version of the current SessionRecord.</returns> public byte[] serialize() { List <SessionStructure> previousStructures = new List <SessionStructure>(); foreach (SessionState previousState in previousStates) { previousStructures.Add(previousState.getStructure()); } RecordStructure record = new RecordStructure { CurrentSession = sessionState.getStructure(), }; record.PreviousSessions.AddRange(previousStructures); return(record.ToByteArray()); }