IDataSerializer.cs 758 B

12345678910111213141516171819202122
  1. using System;
  2. using System.IO;
  3. namespace MediaBrowser.ApiInteraction
  4. {
  5. /// <summary>
  6. /// Since ServiceStack Json is not portable, we need to abstract required json functions into an interface
  7. /// </summary>
  8. public interface IDataSerializer
  9. {
  10. T DeserializeJsonFromStream<T>(Stream stream);
  11. T DeserializeJsvFromStream<T>(Stream stream);
  12. T DeserializeProtobufFromStream<T>(Stream stream);
  13. object DeserializeJsonFromStream(Stream stream, Type type);
  14. object DeserializeJsvFromStream(Stream stream, Type type);
  15. object DeserializeProtobufFromStream(Stream stream, Type type);
  16. bool CanDeserializeJsv { get; }
  17. bool CanDeserializeProtobuf { get; }
  18. }
  19. }