[fpc-pascal] How to poll for a byte in Input?
Michael Van Canneyt
michael at freepascal.org
Fri Dec 9 19:22:44 CET 2011
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.
More information about the fpc-pascal
mailing list