20. septembra 2019 ..:: Software » Blog ::.. Zaregistrovat se  Přihlásit se
   Novinky Minimalizovat  
   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().

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