IMessagePacker.cs 467 B

123456789101112131415161718
  1. using System;
  2. namespace Model
  3. {
  4. public interface IMessagePacker
  5. {
  6. byte[] SerializeToByteArray(object obj);
  7. string SerializeToText(object obj);
  8. object DeserializeFrom(Type type, byte[] bytes);
  9. object DeserializeFrom(Type type, byte[] bytes, int index, int count);
  10. T DeserializeFrom<T>(byte[] bytes);
  11. T DeserializeFrom<T>(byte[] bytes, int index, int count);
  12. T DeserializeFrom<T>(string str);
  13. object DeserializeFrom(Type type, string str);
  14. }
  15. }