"General IE based message handling" Object subclass: IEMessage [ | ies type | IEMessage class >> initWith: type [ ^ (self new) type: type; yourself ] type: aType [ type := aType. ] addIe: aIe [ self ies add: aIe. ] ies [ ies isNil ifTrue: [ ies := OrderedCollection new. ]. ^ ies ] storeOn: aMsg [ aMsg putByte: type. self ies do: [:each | each storeOn: aMsg ] ] ] Object subclass: BCD [ BCD class >> encode: aNumber [ | col num | col := OrderedCollection new. num := aNumber. 1 to: 3 do: [:each | col add: num \\ 10. num := num // 10. ]. ^ col reverse asByteArray ] ]