Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.MS_OXCMAPIHTTPAdapter.ReadHttpResponse C# (CSharp) Method

ReadHttpResponse() private method

Read the HTTP response and get the response bytes.
private ReadHttpResponse ( HttpWebResponse response ) : byte[]
response System.Net.HttpWebResponse The HTTP response need be read.
return byte[]
        private byte[] ReadHttpResponse(HttpWebResponse response)
        {
            Stream respStream = response.GetResponseStream();
            List<byte> responseBytesList = new List<byte>();

            int read;
            do
            {
                read = respStream.ReadByte();
                if (read != -1)
                {
                    byte singleByte = (byte)read;
                    responseBytesList.Add(singleByte);
                }
            }
            while (read != -1);

            return responseBytesList.ToArray();
        }
MS_OXCMAPIHTTPAdapter