Utf16BigEndianView
Description
A <Utf16BigEndianView> provides a bidirectional view over the unicode component as a collection of UTF-16 code units in big-endian format.
• #next/#previous - Answers an 16-bit <Integer>.
• #contents - Answers a <Utf16BE>
Examples
| view beA beB beC |
view := Utf16BigEndianView on: 'abc'.
self assert: [view next = (beA := (OSUInt16 new at: 0 put: $a value; yourself) beUint16At: 0)].
self assert: [view next = (beB := (OSUInt16 new at: 0 put: $b value; yourself) beUint16At: 0)].
self assert: [view next = (beC := (OSUInt16 new at: 0 put: $c value; yourself) beUint16At: 0)].
self assert: [view atEnd].
self assert: [view previous = (beC := (OSUInt16 new at: 0 put: $c value; yourself) beUint16At: 0)].
self assert: [view previous = (beB := (OSUInt16 new at: 0 put: $b value; yourself) beUint16At: 0)].
self assert: [view previous = (beA := (OSUInt16 new at: 0 put: $a value; yourself) beUint16At: 0)].
self assert: [view atStart].
self assert: [view contents asArray = { beA. beB. beC. }]
Class Methods
None
Instance Methods
None
Last modified date: 04/20/2022