[Glass] What is this chunk of memory prefixing my bytearray?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Glass] What is this chunk of memory prefixing my bytearray?

Mariano Martinez Peck
Hi guys,

I found something weird today. If you inspect this:

 ( ServerFileDirectory on: '/dev/random') directoryEntry readStreamDo: [ :s |
s binary.
(s next: 20) asByteArray ]
You get something like:

 Ý5öyoÓT¾àiwð¯p…óž“è( 221, 53, 246, 121, 111, 211, 84, 190, 224, 105, 119, 240, 175, 112, 133, 17, 243, 158, 147, 232)

If you inspect it, the ByteArray is correctly size 20, and each element seems correct. But what are those weird characters I see in the inspector/print?

--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] What is this chunk of memory prefixing my bytearray?

Martin McClure-5
On 11/19/2013 06:44 PM, Mariano Martinez Peck wrote:

> Hi guys,
>
> I found something weird today. If you inspect this:
>
>   ( ServerFileDirectory on: '/dev/random') directoryEntry readStreamDo:
> [ :s |
> s binary.
> (s next: 20) asByteArray ]
> You get something like:
>
>   Ý5öyoÓT¾àiwð¯p…óž“è( 221, 53, 246, 121, 111, 211, 84, 190, 224, 105,
> 119, 240, 175, 112, 133, 17, 243, 158, 147, 232)
>
> If you inspect it, the ByteArray is correctly size 20, and each element
> seems correct. But what are those weird characters I see in the
> inspector/print?

Well, they look like they're the byte array printed as a string of
characters. Certainly the second byte, 53, is the codepoint of $5.

Regards,

-Martin

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] What is this chunk of memory prefixing my bytearray?

Mariano Martinez Peck
Indeed, it was that Martin. Weird, I never saw something like that :)

Thanks!


On Wed, Nov 20, 2013 at 5:06 AM, Martin McClure <[hidden email]> wrote:
On 11/19/2013 06:44 PM, Mariano Martinez Peck wrote:
Hi guys,

I found something weird today. If you inspect this:

  ( ServerFileDirectory on: '/dev/random') directoryEntry readStreamDo:
[ :s |
s binary.
(s next: 20) asByteArray ]
You get something like:

  Ý5öyoÓT¾àiwð¯p… óž“è( 221, 53, 246, 121, 111, 211, 84, 190, 224, 105,
119, 240, 175, 112, 133, 17, 243, 158, 147, 232)

If you inspect it, the ByteArray is correctly size 20, and each element
seems correct. But what are those weird characters I see in the
inspector/print?

Well, they look like they're the byte array printed as a string of characters. Certainly the second byte, 53, is the codepoint of $5.

Regards,

-Martin




--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass