public void CopyFrom(byte[] bytes, int start, FrameHeader verifier) { this._MessageId = bytes[start++]; this._MajorV = bytes[start++]; this._MinorV = bytes[start++]; this._PayloadSize = (bytes[start++] << 8) | bytes[start]; if ((verifier.MessageId != -1) && (this.MessageId != verifier.MessageId)) { throw new InvalidOperationException(SR.GetString("net_io_header_id", new object[] { "MessageId", this.MessageId, verifier.MessageId })); } if ((verifier.MajorV != -1) && (this.MajorV != verifier.MajorV)) { throw new InvalidOperationException(SR.GetString("net_io_header_id", new object[] { "MajorV", this.MajorV, verifier.MajorV })); } if ((verifier.MinorV != -1) && (this.MinorV != verifier.MinorV)) { throw new InvalidOperationException(SR.GetString("net_io_header_id", new object[] { "MinorV", this.MinorV, verifier.MinorV })); } }
public void CopyFrom(byte[] bytes, int start, FrameHeader verifier) { _MessageId = bytes[start++]; _MajorV = bytes[start++]; _MinorV = bytes[start++]; _PayloadSize = (int)((bytes[start++] << 8) | bytes[start]); if (verifier.MessageId != FrameHeader.IgnoreValue && MessageId != verifier.MessageId) { throw new InvalidOperationException(SR.Format(SR.net_io_header_id, "MessageId", MessageId, verifier.MessageId)); } if (verifier.MajorV != FrameHeader.IgnoreValue && MajorV != verifier.MajorV) { throw new InvalidOperationException(SR.Format(SR.net_io_header_id, "MajorV", MajorV, verifier.MajorV)); } if (verifier.MinorV != FrameHeader.IgnoreValue && MinorV != verifier.MinorV) { throw new InvalidOperationException(SR.Format(SR.net_io_header_id, "MinorV", MinorV, verifier.MinorV)); } }