[Q][Smalltalk][hex] converting binary to hex

Ken G. Brown kbrown at tnc.ab.ca
Tue Mar 19 23:34:14 UTC 2002


Perhaps you are right, the string version of the ByteArray may make more
sense, just returning (stream contents)instead of (stream contents)
asByteArray.
The reasoning I suppose was that I was working with a ByteArray since it had
the facility to write 16 bit values into it little endian. Then I just
wanted the ByteArray as hex instead.
  Ken

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org
> [mailto:squeak-dev-admin at lists.squeakfoundation.org]On Behalf Of Bob
> Arning
> Sent: March 19, 2002 4:07 PM
> To: kbrown at tnc.ab.ca; squeak-dev at lists.squeakfoundation.org
> Subject: Re: RE: [Q][Smalltalk][hex] converting binary to hex
>
>
> On Tue, 19 Mar 2002 15:46:04 -0700 "Ken G. Brown"
> <kbrown at tnc.ab.ca> wrote:
> >aByteArray _ #(0 15 16 255) asByteArray.
> >aByteArray asHex. answers - a ByteArray(48 48 48 70 49 48 70 70)
> >
> >Any and all comments will be appreciated.
>
> Ken,
>
> Just curious - why do you want the result as a ByteArray
> rather than a String? Seems to me that a result of '000F10FF'
> is more palatable than a ByteArray(48 48 48 70 49 48 70 70).
>
> Cheers,
> Bob




More information about the Squeak-dev mailing list