仅在 WP8.1 上:无法从 HTTP 流中读取超过 65536 个字节

On WP8.1 ONLY: cannot read more than 65536 bytes off an HTTP Stream

希望有人可以为我苦苦挣扎了很长时间的问题提供任何帮助。

目标:我需要从指定的 URI 读取一个 http 流,我启动并使用以下代码无休止地阅读(我将其精简到最低限度以便真正集中精力关于裸露的沟通问题):

public void StartupStream(Uri uri)
{
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);

    // Start the asynchronous request
    request.BeginGetResponse(OnGetResponse, request);
}
private void OnGetResponse(IAsyncResult asyncResult)
{
    // get the response
    HttpWebRequest req = (HttpWebRequest)asyncResult.AsyncState;
    try
    {
        using (HttpWebResponse resp = (HttpWebResponse)req.EndGetResponse(asyncResult))
        {
            using (Stream s = resp.GetResponseStream())
            {
                // dummy-read the stream forever
                int readBytes = 0;
                byte[] buffer = new byte[4096];
                while (true)
                {
                    readBytes += s.Read(buffer, 0, buffer.Length);
                }
            }
        }
    }
    catch (Exception ex)
    {
        throw;
    }
    finally
    {
        req.Abort();
    }
}

问题:碰巧上面相同的代码在演示桌面 WPF 应用程序上完美运行,读取 "gigabytes" 数据没有任何问题,而在 Windows Phone 8.1 Store App 我最多只能读取65536字节,然后后续调用s.Read(buffer, 0, buffer.Length)(在无限while循环中)永远挂起,无一例外!

我已经尝试过,没有任何结果:

有人知道在 WP 8.1 上使用这种简单的 HTTP Stream 会发生什么吗?怎么会有 65536 字节的读取限制?

感谢您的帮助!

这就是我从网上下载图片的方式。示例中的文件大小为 1131683

     string URL = "http://img.uuhy.com/uploads/2010/05/4423_Free-high-resolution-desktop-wallpaper-8.jpg"; 
        var httpClient = new HttpClient();
        var httpResponse = await httpClient.GetAsync(URL);

       var ImageArray = await httpResponse.Content.ReadAsByteArrayAsync();