public static T Unpack <T>(Serializers allSerializers, byte[] bytes) { var packer = Serializer.SetupDefaultPacker(allSerializers, bytes); var serializer = new GenericSerializer(); var instance = (T)serializer.Unpack(packer, typeof(T)); return(instance); }
public static T UnpackStatic <T>(byte[] bytes, Serializers staticSerializers) { var packer = Serializer.SetupDefaultPacker(staticSerializers, bytes); var serializer = new GenericSerializer(); var result = (T)serializer.Unpack(packer, typeof(T)); packer.Dispose(); return(result); }
public static T Unpack <T>(byte[] bytes, Serializers customSerializers) { var packer = Serializer.SetupDefaultPacker(bytes, customSerializers); var serializer = new GenericSerializer(); var instance = (T)serializer.Unpack(packer, typeof(T)); customSerializers.Dispose(); packer.serializers.Dispose(); return(instance); }