Hledat English (United States)  Čeština (Česká Republika) Slovenčina (Slovenská Republika)  Hrvatski (Hrvatska)
17. října 2017 ..:: Software » Blog ::.. Zaregistrovat se  Přihlásit se
   Novinky Minimalizovat  
     
 Vytiskout   
   Blog Minimalizovat  
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().

     
 Vytiskout   
   Archiv Minimalizovat  
     
 Vytiskout   
Od 12.2. 2007
Celkem
Software
© Đonny 2007   Podmínky používání  Prohlášení o soukromí
DotNetNuke® is copyright 2002-2017 by DotNetNuke Corporation