///<summary>反序列化,读取数据</summary> public override int Read(byte[] _buffer_, int _offset_) { _offset_ = base.Read(_buffer_, _offset_); int _startOffset_ = _offset_; int _toReadLength_ = XBuffer.ReadInt(_buffer_, ref _offset_); //字段个数,最多支持255个 var _fieldNum_ = XBuffer.ReadByte(_buffer_, ref _offset_); do { if (_fieldNum_ > 0) { id_f = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 1) { s1 = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 2) { i1 = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 3) { b1 = XBuffer.ReadBool(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 4) { f1 = XBuffer.ReadFloat(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 5) { s2 = XBuffer.ReadShort(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 6) { d1 = XBuffer.ReadDouble(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 7) { b2 = XBuffer.ReadBytes(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 8) { o1 = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } }while(false); //剔除多余数据 if (_offset_ < _toReadLength_ - _startOffset_) { _offset_ += _toReadLength_ - _startOffset_; } return(_offset_); }