MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

the fastest way to read binary files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33418] the fastest way to read binary files
  • From: "Raf" <r_a_f at yahoo.it>
  • Date: Wed, 20 Mar 2002 01:54:10 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi MathGroup.
The question:
What is the fastest way to read binary files in Mathematica 4.0 ?
I think the fastest is with ReadList (indeed ReadSounFile that use it, seems
to be better than BinaryImport), but when i use this command...
data = ReadList[filePath, Byte]
....it doesn't read whole file; can somebody tell me the reason?

Thanks for your attention,
regards,
Raf.

P.S.:
I made some simple tests (@ 16 bit):

<< Experimental`
data = BinaryImport[fileRawPath, Table["Integer16", {4000}],
ByteOrdering -> -1];    => 10 seconds

data = ReadListBinary[fileRawPath, SignedInt16, ByteOrder ->
LeastSignificantByteFirst];    = > 26 seconds

<< Miscellaneous`Audio`
data = ReadSoundfile[fileWavPath]     => 1.54 seconds



  • Prev by Date: Summing a list of real numbers
  • Next by Date: Rolling up some integers
  • Previous by thread: Re: Summing a list of real numbers
  • Next by thread: Re: the fastest way to read binary files