public static WriteLongTermId ( Stream stream, |
||
stream | Stream | The stream. |
id | A LongTermId value. | |
Résultat | int |
/// <summary> /// Serialize this instance to a stream. /// </summary> /// <param name="stream">A data stream contains serialized object.</param> /// <returns>The number of bytes written to the stream.</returns> public int Serialize(System.IO.Stream stream) { int bytesWriten = 0; string serverDns = string.Empty; for (int i = 0; i < this.ServerDNArray.Length; i++) { serverDns += this.ServerDNArray[i]; } byte[] serverDnBytes = System.Text.Encoding.ASCII.GetBytes(serverDns); bytesWriten += StreamHelper.WriteUInt32(stream, this.Flags); bytesWriten += StreamHelper.WriteUInt32(stream, this.Depth); bytesWriten += StreamHelper.WriteLongTermId(stream, this.FolderLongTermId); bytesWriten += StreamHelper.WriteUInt32(stream, this.ServerDNCount); bytesWriten += StreamHelper.WriteUInt32(stream, this.CheapServerDNCount); bytesWriten += StreamHelper.WriteBuffer(stream, serverDnBytes); return(bytesWriten); }