I need to read very large files so a single ByteArray holding all the
data wouldn't work (not until I get a 64-bit version of Squeak).
However, I could read in one or more structure at-a-time as a
ByteArray and then parse out the data I need, then read the next
sequence. This is kind-of like a buff
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.
On Wed, Jul 2, 2008 at 12:36 AM, David Finlayson <[EMAIL PROTECTED]>
wrote:
> Thanks. T
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 "
Am 01.07.2008 um 07:27 schrieb David Finlayson:
OK, I've got an object that can read int and uint for 8, 16, 24 and 32
bit numbers from a binary file stream. But I cant figure out how to
read a float or double. What I want is something like this (these
don't work):
double
| n |
OK, I've got an object that can read int and uint for 8, 16, 24 and 32
bit numbers from a binary file stream. But I cant figure out how to
read a float or double. What I want is something like this (these
don't work):
double
| n |
n := Float from: (aFileStream next: 32).
^n
> "David" == David T Lewis <[EMAIL PROTECTED]> writes:
David> In addition to the Simon Lewis book that you mentioned, I have found
David> "Smalltalk Best Practice Patterns" by Kent Beck to be something you
David> will want to read sooner rather than later. It's really worthwhile
David> and adm
On Fri, May 23, 2008 at 10:33:32PM -0700, David Finlayson wrote:
>
> I am a scientist not a proffesional programmer,
> but I've been coding all my life and coding is part of my job. That's
> why I am looking into Smalltalk. Can't get much higher level than
> this. Besides, I've always wanted to lea
On Fri, May 23, 2008 at 6:17 PM, David T. Lewis <[EMAIL PROTECTED]> wrote:
>
> Look at the Number class hierarchy (browse hierarchy) and look at the
> "instance creation" category on the class side of each of these classes.
> That will give you some good tips. If you are dealing with simple data
>
On Fri, May 23, 2008 at 02:10:58PM -0700, David Finlayson wrote:
> An instrument I am working with creates a complicated binary file
> (memory dumps of C structs). I would like to try reading the file into
> Squeak for a cool new project. What's the best way to set up and read
> C-based structs and
An instrument I am working with creates a complicated binary file
(memory dumps of C structs). I would like to try reading the file into
Squeak for a cool new project. What's the best way to set up and read
C-based structs and then, once I'm done, to write them back out again
(including endianness,
10 matches
Mail list logo