On Apr 06, 2007, at 18:49 UTC, Drew F. wrote: > So code that used to read: > > For j = 0 to 691199 step 8 > mb.UInt64Value(j) = bs.ReadUInt64 > next > > becomes: > > mb.StringValue(0,691200) = bs.Read(691200) > > Seems to work fine on Mac PPC/Intel and Win XP/Vista. Am I missing > anything? I am doing bitwise operations on the memoryblock, is there > a case when then won't work?
Only if the LittleEndian property of mb is not the same as bs. In that case, your original code will do the proper byte-shuffling, whereas the simpler code will not. And as for mb = bs.Read(691200), that works because there is an Operator_Convert defined for MemoryBlock that takes a String. It creates a new MemoryBlock of the proper length and then assigns to its StringValue, just as you did above. And yes, that's a perfectly valid way to load a binary file into memory too. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
