MemoryPackFormatter.cs 441 B

12345678910111213141516171819
  1. using H.Formatters;
  2. using MemoryPack;
  3. namespace InABox.Formatters
  4. {
  5. public class MemoryPackFormatter<T1> : FormatterBase
  6. {
  7. protected override byte[] SerializeInternal(object obj)
  8. {
  9. return MemoryPackSerializer.Serialize<T1>((T1)obj);
  10. }
  11. protected override T DeserializeInternal<T>(byte[] bytes)
  12. {
  13. return MemoryPackSerializer.Deserialize<T>(bytes);
  14. }
  15. }
  16. }