On Sun, 16 Jun 2013, Michalis Kamburelis wrote:
Michael Van Canneyt wrote:
If an implementation of Read does not return the requested data when in
fact it is available, then the implementation of Read is broken.
I guess it depends how do you interpret TStream.Read documentation...
http://w
Michael Van Canneyt wrote:
If an implementation of Read does not return the requested data when in
fact it is available, then the implementation of Read is broken.
I guess it depends how do you interpret TStream.Read documentation...
http://www.freepascal.org/docs-html/rtl/classes/tstream.read
On Sun, 16 Jun 2013, Michalis Kamburelis wrote:
Michael Van Canneyt wrote:
The above implementation should not be changed, it is Delphi compatible:
TStream.ReadBuffer works on the assumption that Read will always return
the amount of bytes requested if they are available.
So, if you want to
Michael Van Canneyt wrote:
The above implementation should not be changed, it is Delphi compatible:
TStream.ReadBuffer works on the assumption that Read will always return
the amount of bytes requested if they are available.
So, if you want to make changes, there is no reason why TStream.Read
sh
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 thes
On Sun, 16 Jun 2013, Michalis Kamburelis wrote:
Hi,
I'm often reading fixed-size structures using TStream.ReadBuffer, working
under the assumption that it will fail only if it's not possible to read the
requested amount of bytes (that is, if the stream ended prematurely). This is
actually
On 16 Jun 2013, at 03:18, Michalis Kamburelis wrote:
> Ewald wrote:
>> And what with non-blocking pipes pipes? Wait for a *some* period
>> until you get all data? It is up to the programmer to do this INHO.
>
> If you want to get partial data (instead of waiting until all requested data
> is av
Ewald wrote:
And what with non-blocking pipes pipes? Wait for a *some* period
until you get all data? It is up to the programmer to do this INHO.
If you want to get partial data (instead of waiting until all requested
data is available) you should just use TStream.Read instead of
TStream.Read
On 16 Jun 2013, at 01:08, Michalis Kamburelis wrote:
>
>
> Which means that ReadBuffer should retry calling Read, in a loop, trying to
> finish the reading. ReadBuffer should raise an exception only when Read
> returns zero (before we can gather all the Count bytes).
>
And what with non-blo
Hi,
I'm often reading fixed-size structures using TStream.ReadBuffer,
working under the assumption that it will fail only if it's not possible
to read the requested amount of bytes (that is, if the stream ended
prematurely). This is actually the documented usage, see
http://www.freepascal.org
10 matches
Mail list logo