I think the main problem is that TStream tries to abstract two kinds of resources :
Character based resources and block based resources. The end result is that it is no good for neither of the two cases. 2011/12/9 Michael Van Canneyt <mich...@freepascal.org>: > > > On Fri, 9 Dec 2011, Jorge Aldo G. de F. Junior wrote: > >> Thats an old problem on the way TStream was implemented. >> >> I for one needed to know the result size of a uncompress stream (IE.: >> i have a compressed stream and want to know in advance how many bytes >> the uncompress method would yield). > > > This information is not stored in the compressed data. To be able to give > you this number, the compression stream > would need to actually decompress the whole stream. > > >> >> The stream system is currently a mess, sometimes you can know in >> advance how many bytes you can read, sometimes you cant, depends on >> the class you are dealing with. > > > There are simply streams which have no size. > > In each case, I am working on the 'StreamCapabilities' property, which > should be able to tell you what is available. > > > Michael. > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal