On Wed, Jun 2, 2010 at 07:17, Holger Hans Peter Freyther <[email protected]> wrote: > Hi All, > > for the stuff I am planing to use GNU Smalltalk for I will need to > create binary structures. This means I need to write numbers and similar > as uint8,16,32,64, control the endian of these numbers and such. In > Pharo I have found the DataStream class is there something like this in > GNU Smalltalk? How would I solve my usecase in GNU Smalltalk?
For native endianness you can create a CStruct subclass and remember to instantiate it with #gcNew instead of #new. For specific endianness it is probably best to enhance the primitives that access CObjects so that they take care of changing endianness. This would be similar overall to how CArray/CPtr work (i.e. wrap the original CObject) but of course the field type would still be scalar. The simplest thing to do is of course to use CStruct and do the endianness conversion yourself. Paolo _______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
