ZstdCompressor.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 
  2. using XGame.Framework.Utils;
  3. namespace XGame.Framework.Network
  4. {
  5. public class ZstdCompressor : IMsgCompressor
  6. {
  7. public void Compress(ref byte[] bytes, ref int offset, ref int length)
  8. {
  9. //TODO zstd压缩
  10. return;
  11. //var body = new byte[length];
  12. //System.Array.Copy(bytes, offset, body, 0, length);
  13. ////body = SecurityUtils.ZstdCompress(body);
  14. //var target = new byte[offset + body.Length];
  15. //System.Array.Copy(bytes, 0, target, 0, offset);
  16. //System.Array.Copy(body, 0, target, offset, body.Length);
  17. //bytes = target;
  18. //length = body.Length;
  19. //////return BytesWrapperPool.Acquire(target, offset, body.Length);
  20. }
  21. public void Decompress(ref byte[] bytes, ref int offset, ref int length)
  22. {
  23. //TODO zstd压缩
  24. return;
  25. //var body = new byte[length];
  26. //System.Array.Copy(bytes, offset, body, 0, length);
  27. ////body = SecurityUtils.ZstdDecompress(body);
  28. //var target = new byte[offset + body.Length];
  29. //System.Array.Copy(bytes, 0, target, 0, offset);
  30. //System.Array.Copy(body, 0, target, offset, body.Length);
  31. //bytes = target;
  32. //length = body.Length;
  33. ////return BytesWrapperPool.Acquire(target, offset, body.Length);
  34. }
  35. }
  36. }