public void Write(PainlessBinaryWriter writer) { WriteUnderlyingTypeFunction writeFunction = _writeFunctions[_underlyingType]; object underlyingValue = Convert.ChangeType(Value, _underlyingType); writeFunction(writer, underlyingValue); }
public void Write(PainlessBinaryWriter writer) { writer.Write(_listLength); for (int index = 0; index < _listLength; ++index) { writer.WritePainlessBinaryObject(_contentType, _list[index]); } }
public void Write(PainlessBinaryWriter writer) { writer.Write(_arrayLength); for (int rank = 0; rank < _rank; ++rank) { for (int index = 0; index < _arrayLength; ++index) { writer.WritePainlessBinaryObject(_elementType, _array[index]); } } }
public void Write(PainlessBinaryWriter writer, Type fullType) { writer.Write(_id); Type elementType = fullType.GetElementType(); writer.WriteType(elementType); int rank = fullType.GetArrayRank(); writer.Write(rank); }
public void Write(PainlessBinaryWriter writer) { writer.PushCompoundingHash(); foreach (SerializedMember member in _members) { object rawValue = member.GetValue(Value); writer.WritePainlessBinaryObject(member.Type, rawValue); } int computedHash = writer.PopCompoundingHash(); writer.Write(computedHash); }
public void SerializeFile <T>(Stream dataStream, SerializationFile <T> file) { if (file == null) { throw new ArgumentNullException(nameof(file)); } using (StreamWrapper streamWrapper = new StreamWrapper(dataStream)) { using (PainlessBinaryWriter writer = new PainlessBinaryWriter(streamWrapper, _typeManager, HashBaseValue, HashMultiplicationConstant)) { SerializeFilePayload(writer, file.Payload); } } }
public void Write(PainlessBinaryWriter writer, Type fullType) { writer.Write(_id); int numGenericParameters = CountNumberGenericParameters(_baseType); if (numGenericParameters == 0) { return; } Type[] genericArguments = fullType.GetGenericArguments(); for (int index = 0; index < numGenericParameters; ++index) { writer.WriteType(genericArguments[index]); } }
void SerializeFilePayload <T>(PainlessBinaryWriter writer, T payload) { writer.WriteType(typeof(T)); writer.WritePainlessBinaryObject(typeof(T), payload); }
public void Write(PainlessBinaryWriter writer) { object containedValue = _valuePropertyInfo.GetValue(Value); writer.WritePainlessBinaryObject(_contentType, containedValue); }
public void Write(PainlessBinaryWriter writer) { _readWriteOperations.WriteFunction(writer, _value); }