Microsoft.Protocols.TestSuites.MS_OXCFXICS.FastTransferStream.ReadString8 C# (CSharp) Method

ReadString8() public method

Read a ASCII string value from stream, and advance the position.
public ReadString8 ( ) : string
return string
        public string ReadString8()
        {
            byte tmp;
            byte[] buffer = new byte[1];
            StringBuilder b = new StringBuilder();
            do
            {
                this.Read(buffer, 0, 1);
                tmp = buffer[0];
                b.Append(Convert.ToChar(tmp));
            }
            while (tmp != 0);
            return b.ToString();
        }

Usage Example

        /// <summary>
        /// Initializes a new instance of the FolderReplicaInfo structure.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public FolderReplicaInfo(FastTransferStream stream)
        {
            this.Flags = stream.ReadUInt32();
            this.Depth = stream.ReadUInt32();
            this.FolderLongTermId = new LongTermId
            {
                DatabaseGuid = stream.ReadGuid().ToByteArray(),
                GlobalCounter = new byte[6]
            };
            stream.Read(
                this.FolderLongTermId.GlobalCounter,
                0,
                this.FolderLongTermId.GlobalCounter.Length);
            stream.Read(new byte[2], 0, 2);
            this.ServerDNCount = stream.ReadUInt32();
            this.CheapServerDNCount = stream.ReadUInt32();
            this.ServerDNArray = new string[this.ServerDNCount];

            for (int i = 0; i < this.ServerDNCount; i++)
            {
                this.ServerDNArray[i] = stream.ReadString8();
            }
        }
All Usage Examples Of Microsoft.Protocols.TestSuites.MS_OXCFXICS.FastTransferStream::ReadString8