using System;
using System.IO;
namespace Umbraco.Core.Serialization
{
public class SerializationService : AbstractSerializationService
{
private readonly ISerializer _serializer;
public SerializationService(ISerializer serializer)
{
_serializer = serializer;
}
#region Overrides of AbstractSerializationService
///
/// Finds an with a matching , and deserializes the to an object graph.
///
///
///
///
///
public override object FromStream(Stream input, Type outputType, string intent = null)
{
if (input.CanSeek && input.Position > 0) input.Seek(0, SeekOrigin.Begin);
return _serializer.FromStream(input, outputType);
}
///
/// Finds an with a matching , and serializes the object graph to an .
///
///
///
///
public override IStreamedResult ToStream(object input, string intent = null)
{
return _serializer.ToStream(input);
}
#endregion
}
}