0

I want to retrieve the same image from 2 different sources and merge them together.

using (var stream = webclient.OpenRead("http://media-cdn.tripadvisor.com/media/photo-s/01/70/3e/a9/needed-backup-lol.jpg"))
using (var stream2 = webclient.OpenRead("http://img135.imageshack.us/img135/93/neededbackuplol.jpg"))

let's suppose that I use Stream.Read:

stream.Read(buffer, 0, 100)
stream2.Read(buffer, 100, 200)

my question is do those 2 connection always send me THE ENTIRE IMAGE or JUST THE PART that im requesting? I mean, when i use stream.read(buffer, 100, 200) I will receive only 100 byte or I will still receive the entire image and then just cut the part that im interesting in?

Simone
  • 332
  • 4
  • 16
  • since you are not sending the "I want to read from position 100" to the webclient, the most reasonable would be that you are receiving the whole stream and then cutting it. – default May 19 '12 at 12:26
  • so I do I ask to the webclient just the part that I want? – Simone May 19 '12 at 12:28

1 Answers1

2

Consider using HttpWebRequest and HTTP RANGE headers as described here: How to specify range >2GB for HttpWebRequest in .NET 3.5

Community
  • 1
  • 1
Daniel Mošmondor
  • 19,718
  • 12
  • 58
  • 99