Reads a WORD (16 bits) using in little-endian byte ordering.
| 294 | |
| 295 | // Reads a WORD (16 bits) using in little-endian byte ordering. |
| 296 | uint16_t Decoder::read16() |
| 297 | { |
| 298 | uint8_t b1 = m_file->read8(); |
| 299 | uint8_t b2 = m_file->read8(); |
| 300 | |
| 301 | if (m_file->ok()) { |
| 302 | return ((b2 << 8) | b1); // Little endian |
| 303 | } |
| 304 | else |
| 305 | return 0; |
| 306 | } |
| 307 | |
| 308 | // Reads a DWORD (32 bits) using in little-endian byte ordering. |
| 309 | uint32_t Decoder::read32() |