1259 |
1259 |
1260 unsignedShortAt:index bigEndian:msb |
1260 unsignedShortAt:index bigEndian:msb |
1261 "return the 2-bytes starting at index as an (unsigned) Integer. |
1261 "return the 2-bytes starting at index as an (unsigned) Integer. |
1262 The index is a smalltalk index (i.e. 1-based). |
1262 The index is a smalltalk index (i.e. 1-based). |
1263 The value is retrieved MSB-first (high 8 bits at lower index) if msb is true; |
1263 The value is retrieved MSB-first (high 8 bits at lower index) if msb is true; |
1264 LSB-first (i.e. low 8-bits at lower byte index) if its false)" |
1264 LSB-first (i.e. low 8-bits at lower byte index) if it's false)" |
1265 |
1265 |
1266 ^ self unsignedInt16At:index MSB:msb |
1266 ^ self unsignedInt16At:index MSB:msb |
1267 |
1267 |
1268 "Modified: / 21.1.1998 / 17:46:07 / cg" |
1268 "Modified: / 21-01-1998 / 17:46:07 / cg" |
1269 "Created: / 5.3.1998 / 11:49:29 / stefan" |
1269 "Created: / 05-03-1998 / 11:49:29 / stefan" |
|
1270 "Modified (comment): / 13-02-2017 / 20:34:05 / cg" |
1270 ! |
1271 ! |
1271 |
1272 |
1272 unsignedShortAt:index put:value |
1273 unsignedShortAt:index put:value |
1273 "set the 2-bytes starting at index from the (unsigned) Integer value. |
1274 "set the 2-bytes starting at index from the (unsigned) Integer value. |
1274 The index is a smalltalk index (i.e. 1-based). |
1275 The index is a smalltalk index (i.e. 1-based). |
1325 |
1326 |
1326 wordAt:index MSB:msb |
1327 wordAt:index MSB:msb |
1327 "return the 2-bytes starting at index as an (unsigned) Integer. |
1328 "return the 2-bytes starting at index as an (unsigned) Integer. |
1328 The index is a smalltalk index (i.e. 1-based). |
1329 The index is a smalltalk index (i.e. 1-based). |
1329 The value is retrieved MSB (high 8 bits at lower index) if msb is true; |
1330 The value is retrieved MSB (high 8 bits at lower index) if msb is true; |
1330 LSB-first (i.e. low 8-bits at lower byte index) if its false. |
1331 LSB-first (i.e. low 8-bits at lower byte index) if it's false. |
1331 Notice: |
1332 Notice: |
1332 the index is a byte index; thus, this allows for unaligned access to |
1333 the index is a byte index; thus, this allows for unaligned access to |
1333 words on any boundary. |
1334 words on any boundary. |
1334 Question: should it be retrieve signed values ? (see ByteArray>>signedWordAt:)" |
1335 Question: should it be retrieve signed values ? (see ByteArray>>signedWordAt:)" |
1335 |
1336 |
1336 ^ self unsignedInt16At:index MSB:msb |
1337 ^ self unsignedInt16At:index MSB:msb |
|
1338 |
|
1339 "Modified (comment): / 13-02-2017 / 20:34:09 / cg" |
1337 ! |
1340 ! |
1338 |
1341 |
1339 wordAt:index put:value |
1342 wordAt:index put:value |
1340 "set the 2-bytes starting at index from the (unsigned) Integer value. |
1343 "set the 2-bytes starting at index from the (unsigned) Integer value. |
1341 The index is a smalltalk index (i.e. 1-based). |
1344 The index is a smalltalk index (i.e. 1-based). |