delphi - TStream.Position compared to TStream.Seek -


to move "current byte" pointer in tstream class can use property position (e.g. mystream.position := 0) or using seek method (e.g. mystream.seek(0, sofrombeginning). question is, 1 more efficient (aka faster)? (i don't have source, not check myself).

so far use seek in positioning said pointer.

as tstream.seek overloaded function handling 32-bit or 64-bit values, depends on current stream implementation, might better choice.

for instance tcustommemorystream implements 32-bit version of seek(). when set position on stream first call 64-bit version, casts value longint while calling 32-bit version. (this change 64-bit version of delphi!)

on other hand thandlestream implements 64-bit version of seek(). when call seek() 32-bit value end in quite nasty mechanism calling 64-bit version.

my personal advice set position. @ least better choice in future.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -