Write ConnectStream into MemoryStream



我正在使用此代码将ConnectStream写入MemoryStream:

        buffer = new byte[8 * 1024];
        while ((len = stream.Read(buffer, 0, buffer.Length)) > 0)
        {
            mStream.Write(buffer, 0, len);
        }

,但我总是有一个错误:

there was a problem reading this document (109)

循环完成后,将存储器放在流的末端。从中读取不会产生任何东西。添加:

  mStream.Position = 0;

相关内容

  • 没有找到相关文章