public void Update(IMessageClient messageClient) { byte[] body = base.body as byte[]; byte[] binaryId = messageClient.GetBinaryId(); for (int i = Scan(body, this._lastPattern, 0); i != -1; i = Scan(body, this._lastPattern, 0)) { Array.Copy(binaryId, 0, body, i, binaryId.Length); } this._lastPattern = binaryId; }
internal void Update(IMessageClient messageClient) { byte[] binaryContent = this.body as byte[]; byte[] destClientBinaryId = messageClient.GetBinaryId(); int patternPosition = Scan(binaryContent, _lastPattern, 0); while (patternPosition != -1) { Array.Copy(destClientBinaryId, 0, binaryContent, patternPosition, destClientBinaryId.Length); patternPosition = Scan(binaryContent, _lastPattern, 0); } _lastPattern = destClientBinaryId; }