avslivker
08-29-2003, 01:36 PM
I am doing a simple task of downloading image of the http url.
I am using IWeb interface.
1. Once connected to my server with the specified url I get hit in my Web response callback with WebRespInfo*.
2. Using ISource member from WebRespInfo* I create IAStream from ISource
3. I call IIMAGE_Notify(pIImage,OnImageLoaded,pUser) to setup "image complete callback"
4. I call IIMAGE_SetStream(pIImage, ppIAStream) on created IAStream.
Surprisingly! - I am hit in my OnImageLoaded callback and if I display image - it shows OK.
Now closer to my actual question:
ISource that I get from the web response contains HTTP stream
that starts with HTTP text lines (HTTP headers) until it finally goes to the body of HTTP request where the binary of my image is.
IAStream created out of ISource is probably some sort of asyncronious version of a stream built on top of ISource. Obviously neither of them has knowledge where the data I am interested in strats from.
So finally my actual question:
How does IImage knows that it needs to load data of IAStream with some offset from original HTTP stream data?
The answer to this question would help a lot to understand the undelying concepts of Brew SDK and hence to program against it more effectively.
Thank you,
Andrew Slivker
I am using IWeb interface.
1. Once connected to my server with the specified url I get hit in my Web response callback with WebRespInfo*.
2. Using ISource member from WebRespInfo* I create IAStream from ISource
3. I call IIMAGE_Notify(pIImage,OnImageLoaded,pUser) to setup "image complete callback"
4. I call IIMAGE_SetStream(pIImage, ppIAStream) on created IAStream.
Surprisingly! - I am hit in my OnImageLoaded callback and if I display image - it shows OK.
Now closer to my actual question:
ISource that I get from the web response contains HTTP stream
that starts with HTTP text lines (HTTP headers) until it finally goes to the body of HTTP request where the binary of my image is.
IAStream created out of ISource is probably some sort of asyncronious version of a stream built on top of ISource. Obviously neither of them has knowledge where the data I am interested in strats from.
So finally my actual question:
How does IImage knows that it needs to load data of IAStream with some offset from original HTTP stream data?
The answer to this question would help a lot to understand the undelying concepts of Brew SDK and hence to program against it more effectively.
Thank you,
Andrew Slivker