Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Code Optimization (https://www.delphipraxis.net/160358-code-optimization.html)

rollstuhlfahrer 9. Mai 2011 21:44

AW: Code Optimization
 
Zitat:

Zitat von sdean (Beitrag 1099865)
but FredlFesl : your improved / modified and untested version writes Only 1MB to FFile
i mean the FFile will only hold 1MB of the Source Stream not the Whole Stream size .

This code actually copies the whole Stream, not just 1MB. The 1MB is the chuncksize. In this code there is a Repeat-Until-Structure, which repeats until the whole stream is copied.

Bernhard

FredlFesl 10. Mai 2011 06:28

AW: Code Optimization
 
Zitat:

Zitat von sdean (Beitrag 1099865)
but FredlFesl : your improved / modified and untested version writes Only 1MB to FFile
i mean the FFile will only hold 1MB of the Source Stream not the Whole Stream size .

No. It writes the whole file. Notice the "REPEAT UNTIL" loop. It reads 1MB data from the source and appends it to the file. Then in reads the next 1MB.... until there is no more data in the source.


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:32 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz