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