Accessing byte arrays...
Dino
gte949e at prism.gatech.edu
Mon Apr 12 06:18:22 UTC 1999
Ahh... stupid me... figured it out before... but thanks for the responses...
-- Dino
"Andrew C. Greenberg" wrote:
>
> >Hi, I need to be able to make, modify and create byte arrays. How
> >do I go about
> >doing this? I hope this does not involve creating a whole bunch of pluggable
> >primitives.
>
> Just as with Array, IntegerArray. String and the host of other
> indexable classes, you create with:
>
> array := ByteArray new: sizeOfArray,
>
> then, to access a slot:
>
> array at: index.
>
> or, to assign to a slot:
>
> array at: index put: value.
>
> Remember that Smalltalk array indexing begins at 1. Hope that's
> concrete enough for your purposes. There are a host of other
> operations on such arrays and their slices, which you can find from
> reading the classes.
More information about the Squeak-dev
mailing list
|