void ReadIntoArray(PainlessBinaryReader reader, IList destination) { for (int index = 0; index < _arrayLength; ++index) { destination[index] = reader.ReadPainlessBinaryObject(_elementType); } }
public void Read(PainlessBinaryReader reader) { for (int index = 0; index < _listLength; ++index) { object value = reader.ReadPainlessBinaryObject(_contentType); _list.Add(value); } }
static T DeserializeFilePayload <T>(PainlessBinaryReader reader) { Type fileType = reader.ReadNextType(); if (fileType != typeof(T)) { throw new DifferentFileTypeException(typeof(T), fileType); } object deserializedObject = reader.ReadPainlessBinaryObject(typeof(T)); return((T)deserializedObject); }
public void Read(PainlessBinaryReader reader) { reader.PushCompoundingHash(); foreach (SerializedMember member in _members) { object memberValue = reader.ReadPainlessBinaryObject(member.Type); member.SetValue(Value, memberValue); } int computedHash = reader.PopCompoundingHash(); int readHash = reader.ReadInt32(); if (computedHash != readHash) { throw new DataIntegrityQuestionableException(computedHash, readHash); } }
public void Read(PainlessBinaryReader reader) { Value = reader.ReadPainlessBinaryObject(_contentType); }