Yes, if you can load the contents on a ByteArray you can use the method:
array floatAt: position
It works just fine to read contents written from a C program, and I think it is a bit simpler.
Cheers.
r.
Thanks. The following methods work, can they be improved/simplified?
double
" returns a double "
| n a b |
a := self uint32.
b := self uint32.
n := Float new: 2.
n at: 1 put: b.
n at: 2 put: a.
^n
float
" returns a float "
^Float fromIEEE32Bit: self uint32.
uint32
" Answer the next unsigned, 32-bit integer from this little endian
(binary) stream "
^ aFileStream nextLittleEndianNumber: 4
_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners