Search English (United States)  Čeština (Česká Republika) Slovenčina (Slovenská Republika)  Hrvatski (Hrvatska)
Friday, August 23, 2019 ..:: Software » Blog ::.. Register  Login
   Novinky Minimize  
     
 Print   
   Blog Minimize  
By Đonny on 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().

     
 Print   
   Archiv Minimize  
     
 Print   
Od 12.2. 2007
Celkem
Software
© Đonny 2007   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2019 by DotNetNuke Corporation