i have the following static class with generic methods and i'm wondering if it's safe to use it from different threads and with different objects? i'm not sure how this works below the covers so an explanation of would help
public static class Serialization
{
public static byte[] Serialize<T>(T obj)
{
using (var ms = new MemoryStream())
{
Serializer.SerializeWithLengthPrefix<T>(ms, obj, PrefixStyle.Base128);
return ms.ToArray();
}
}
public static T DeSerialize<T>(byte[] bytes)
{
using (var ms = new MemoryStream(bytes))
{
return Serializer.DeserializeWithLengthPrefix<T>(ms, PrefixStyle.Base128);
}
}
}