| 394 | } |
| 395 | |
| 396 | inline void Serialize(TParts& parts) { |
| 397 | TMemoryOutput out(Buf, sizeof(Buf)); |
| 398 | |
| 399 | ::Save(&out, (ui32)MsgLen()); |
| 400 | ::Save(&out, Guid); |
| 401 | ::Save(&out, (ui32) Loc.Service.size()); |
| 402 | |
| 403 | if (Loc.Service.size() > out.Avail()) { |
| 404 | parts.Push(TStringBuf(Buf, out.Buf())); |
| 405 | parts.Push(Loc.Service); |
| 406 | } else { |
| 407 | out.Write(Loc.Service.data(), Loc.Service.size()); |
| 408 | parts.Push(TStringBuf(Buf, out.Buf())); |
| 409 | } |
| 410 | |
| 411 | parts.Push(Msg.Data); |
| 412 | } |
| 413 | |
| 414 | inline size_t Length() const noexcept { |
| 415 | return sizeof(ui32) + MsgLen(); |