Traži English (United States)  Čeština (Česká Republika) Slovenčina (Slovenská Republika)  Hrvatski (Hrvatska)
20. rujan 2019 ..:: Software » Blog ::.. Registrirajte se  Prijava
   Novinky Minimiziraj  
     
 Ispis   
   Blog Minimiziraj  
Od Đonny na 17.6.2008 12:35

Recently I've discovered that when you have to work with large binary file byte-by-byte (ie. parse it using aan automaton), it is much more fater to load it using IO.File.ReadAllBytes() to byte array and then create IO.MemoryStream over such array than using stream retuned by IO.File.Open.
I've loop that used stream.ReadByte() again and again to iterate through file (cca 250MB) and it took several minutes using FileStream and several seconds using MemoryStream.
Writing slightly altered this file back to disk using FileStream (IO.File.Open) is quite fast as long as you preset file size using SetLength().

     
 Ispis   
   Archiv Minimiziraj  
     
 Ispis   
Od 12.2. 2007
Celkem
Software
© Đonny 2007   Uvjeti uporabe  Izjava o privatnosti
DotNetNuke® is copyright 2002-2019 by DotNetNuke Corporation