[Pharo-users] What is your preferred way for storing ByteArray's as text?

Esteban A. Maringolo emaringolo at gmail.com
Thu Oct 29 14:43:10 EDT 2015

2015-10-29 15:21 GMT-03:00 Peter Uhnák <i.uhnak at gmail.com>:
>> >>> Option A) The printString of ByteArray, it is #[23 12 253 ...]
>> >>> Option B) A Base64 encoded version of the ByteArray
> I like this one, because it is not Pharo-specific format. ByteArray is not
> pharo-specific, but the syntax is --- I can copy paste base64 from/to
> outside world.
> Plus base64 has better tool support in the wild.

I also prefer base64 even over native binary storage.

I ran a small comparison[1] of speed and size and these were my results.

ByteArray size: 19448860

Base64MimeConverter: ''0.592 per second''
#hex: ''0.666 per second''
#asString: ''6.898 per second''
ZnBase64Encoder ''0.459 per second''

Base64MimeConverter: 26291980
#hex: 38897720
#asString: 19448860
ZnBase64Encoder 25931816

Esteban A. Maringolo

[1]: http://ws.stfx.eu/47PV2GUP9ITS

More information about the Pharo-users mailing list