/// <summary>
 /// Deserializes a value from the given reader.
 /// </summary>
 /// <typeparam name="T">The type to deserialize.</typeparam>
 /// <param name="reader">The reader to use.</param>
 /// <returns>The deserialized value.</returns>
 public static T DeserializeValue <T>(IDataReader reader)
 {
     return(Serializer.Get <T>().ReadValue(reader));
 }
 /// <summary>
 /// Serializes the given value using the given writer.
 /// </summary>
 /// <typeparam name="T">The type of the value to serialize.</typeparam>
 /// <param name="value">The value to serialize.</param>
 /// <param name="writer">The writer to use.</param>
 public static void SerializeValue <T>(T value, IDataWriter writer)
 {
     Serializer.Get <T>().WriteValue(value, writer);
     writer.FlushToStream();
 }
 /// <summary>
 /// Deserializes a value from the given reader. This might fail with primitive values, as they don't come with metadata.
 /// </summary>
 /// <param name="reader">The reader to use.</param>
 /// <returns>The deserialized value.</returns>
 public static object DeserializeValueWeak(IDataReader reader)
 {
     return(Serializer.Get <object>().ReadValueWeak(reader));
 }
 /// <summary>
 /// Serializes the given value using the given writer.
 /// </summary>
 /// <param name="value">The value to serialize.</param>
 /// <param name="writer">The writer to use.</param>
 public static void SerializeValueWeak(object value, IDataWriter writer)
 {
     Serializer.GetForValue(value).WriteValueWeak(value, writer);
     writer.FlushToStream();
 }