/// <summary> /// Length in bytes of the object when serialised. /// </summary> /// <returns> /// Numbers of bytes when serialised. /// </returns> public int Length() { var writer = new NatWriter(Stream.Null); Write(writer); return(writer.Position); }
/// <summary> /// Writes the NAT message. /// </summary> /// <param name="writer"> /// The destination for the NAT message. /// </param> /// <remarks> /// Derived classes must override this. /// </remarks> public abstract void Write(NatWriter writer);