// Open a binary file for reading std::ifstream file("data.bin", std::ios::in | std::ios::binary); // Create a SeekableReadStream object for the file cpp_common::SeekableReadStream stream(file); // Read a 32-bit unsigned integer in little-endian byte order from the file uint32_t value = stream.readUint32LE();
// Read a 32-bit unsigned integer from a buffer in little-endian byte order const char* buffer = "\x01\x02\x03\x04"; cpp_common::SeekableReadStream stream(buffer, 4); uint32_t value = stream.readUint32LE();This example creates a SeekableReadStream object for a buffer containing four bytes in little-endian byte order. The readUint32LE method is then used to read a 32-bit unsigned integer from the buffer, which is stored in the variable `value`. The cpp_common library is an open-source library for C++ that provides common classes and utilities that can be used in various projects.