| 380 | } |
| 381 | |
| 382 | size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) { |
| 383 | if (byteOrder == littleEndian) { |
| 384 | buf[0] = static_cast<byte>(s & 0x00ffU); |
| 385 | buf[1] = static_cast<byte>((s & 0xff00U) >> 8); |
| 386 | } else { |
| 387 | buf[0] = static_cast<byte>((s & 0xff00U) >> 8); |
| 388 | buf[1] = static_cast<byte>(s & 0x00ffU); |
| 389 | } |
| 390 | return 2; |
| 391 | } |
| 392 | |
| 393 | size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) { |
| 394 | if (byteOrder == littleEndian) { |