[fpc-pascal] TStream.ReadBuffer doesn't try hard enough to read the requested bytes

Michalis Kamburelis michalis.kambi at gmail.com
Sun Jun 16 18:52:19 CEST 2013

Ewald wrote:
> The question that arises here is whether all the `ReadByte`,
> `ReadWord`, `WriteByte`, `WriteWord`, `WriteBuffer`, ... should also
> `try harder`? Same issue there: no data is returned about the actual
> number of bytes read. Anyway, I leave that to someone who knows the
> internals of these classes.

ReadByte, WriteByte and friends already use ReadBuffer / WriteBuffer 
underneath. E.g. TStream.ReadByte simply calls ReadBuffer(b,1). So 
fixing ReadBuffer / WriteBuffer would automatically also fix them :)

Streams are implemented in rtl/objpas/classes/streams.inc in FPC sources.


More information about the fpc-pascal mailing list