read/write calls inside kaffe

Stefan Burstroem f94sbu at efd.lth.se
Thu Apr 15 10:12:32 PDT 1999


In article <37166C37.8EA82094 at transvirtual.com> you wrote:
>> Hm, that means that you have to change the io handlers of the jpeg and gif
>> calls backs to use KREAD too doesn't it?

>I shouldn't be so fast with my answers :-) Yes, indeed, the libjpeg fread was
>the reason why I switched over to fopen. We could resort to read in the file
>in java and produce from a buffer (like the URL prod), but that might eat up
>a lot of memory. The best soultion seems to be a alternate source method
>(like the buffer source thing).

>Anyway, I don't want to patch libjpeg for that purpose.

Well, you can simply have a custom fill_input_buffer function that you give
to libjpeg.

I have almost finished the code, I just have to make sure it compiles. I
have no way of testing so that it works since Kaffe currently doesn't run
on my system, but it shouldn't be any problems with it.

I'll post the patches later tonight.

As a side effect, this could actually be used to create a jpeg image from a
http stream too. Just make a custom fill_buffer function that takes the
first n bytes from the DataStream object at the first reads and when the
DataStream is drained, switch over to use KREAD calls on the socket the url
is grabbed from. It will work but maybe it is a little overkill at this
moment.

regards, Stefan Burstroem

-----------------------------------------------------------------------
>> Irl: Stefan Burstroem <<  >> Omnipresence Intl. <<  >> Irc: Yabba <<
 >> Phone: +46 (0)46-211 40 84 << >> EMail: stefan at omnipresence.com <<
-----------------------------------------------------------------------



More information about the kaffe mailing list