On Feb 16, 2007, at 2:29 PM, Tim Jones wrote:

Hi Folks,

I'm trying to track down the best way to parse a binary file, searching for specific sequences of bytes. I assume that reading the file into a MemoryBlock (the files tend to be a few 100K at worst) will be the best solution, but what would then be used to walk though the memoryblock to locate the sequence of bytes (sort of like InStrB)?

I would just use InStrB on a string. As long as you don't do "bad stuff" then it should be reasonably quick. Of course I don't know what kind of files they are or what you're using them for, but I've parsed decent sized files before using InStrB and it didn't take an unreasonable amount of time.

I was not doing random searches though. I was parsing the file from beginning to end. So it was something like, look for first marker then from there look for second marker and stuff all those bytes into a variable. Then continue from where I left off and repeat until the EOF.

Kevin
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to