public static Decompress ( byte content ) : byte[] | ||
content | byte | |
return | byte[] |
public void Run(Opcode opcode, byte[] messageBytes) { int offset = 0; uint flagUInt = BitConverter.ToUInt32(messageBytes, 2); bool isCompressed = (byte)(flagUInt >> 24) == 1; if (isCompressed) // 表示有压缩,需要解压缩 { messageBytes = ZipHelper.Decompress(messageBytes, 6, messageBytes.Length - 6); offset = 0; } else { offset = 6; } uint rpcId = flagUInt & 0x0fff; this.RunDecompressedBytes(opcode, rpcId, messageBytes, offset); }