On Thu, 13 Apr 2000, Paul Kappler wrote: > > c) Someone said the counter thing didn't belong in the conduit class, so I > > had > > a > > look and agreed. It is not there anymore, instead I wrote a > > CounterOutputStream > > that can be hooked on to the datatunnel count how much is streamed. I > > updated > > the clients for this. It borked the client interface a little, so I also > > fixed > > the FGUI thing (I couldn't get the progress bar to draw right on Inserts > > though, > > but I didn't touch any of that so I don't know why - sorry if I screwed > > something up for you guys). > > It seems data not part of the file is counted before the counter knows the > size of the file, in simple insert client. Does this make sense? Is there > other data like this at the end of a file? Is your new method is counting > all data on the stream?
The pipe will buffer some data, yeah, so it jumps a little in the beginning. The thing was that as out of placed as the counter was in the conduit, it was even more out of place in the sendMessage method. So in order to read the amount of bytes somewhere, I made the data make an extra loop through a conduit and a pipe where I could listen. I would be most interested in seeing any other solution for doing this in a nice way (one idea might be to use FileInputStream.available() which returns the number of bytes left in the file AFAIK). > > > Paul > > > _______________________________________________ > Freenet-dev mailing list > Freenet-dev at lists.sourceforge.net > http://lists.sourceforge.net/mailman/listinfo/freenet-dev -- Oskar Sandberg md98-osa at nada.kth.se #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1 lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/) _______________________________________________ Freenet-dev mailing list Freenet-dev at lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/freenet-dev
