public override void ToBuffer(ref TSMessagePackWriter writer) { writer.WriteByte(Tag); writer.Skip(1, out var position); writer.WriteByte((byte)ServiceType); writer.Skip(1, out var serviceProviderLengthPosition); writer.WriteString(ServiceProvider); writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - serviceProviderLengthPosition - 1), serviceProviderLengthPosition); writer.Skip(1, out int SeviceNameLengthPosition); writer.WriteString(ServiceName); writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - SeviceNameLengthPosition - 1), SeviceNameLengthPosition); writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); }