SerializeHelper.cs 657 B

12345678910111213141516171819202122232425262728
  1. using System.IO;
  2. using System;
  3. namespace ET
  4. {
  5. public static class SerializeHelper
  6. {
  7. public static object Deserialize(Type type, byte[] bytes, int index, int count)
  8. {
  9. return ProtobufHelper.Deserialize(type, bytes, index, count);
  10. }
  11. public static byte[] Serialize(object message)
  12. {
  13. return ProtobufHelper.Serialize(message);
  14. }
  15. public static void Serialize(object message, Stream stream)
  16. {
  17. ProtobufHelper.Serialize(message, stream);
  18. }
  19. public static object Deserialize(Type type, Stream stream)
  20. {
  21. return ProtobufHelper.Deserialize(type, stream);
  22. }
  23. }
  24. }