Error “This stream does not support seek operations” in C#
You probably want something like this. Either checking the length fails, or the BinaryReader is doing seeks behind the scenes. HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(url); WebResponse myResp = myReq.GetResponse(); byte[] b = null; using( Stream stream = myResp.GetResponseStream() ) using( MemoryStream ms = new MemoryStream() ) { int count = 0; do { byte[] buf = … Read more