#includeint main() { uint8_t buffer[2] = {0x08, 0x06}; // Little-endian representation of the number -2040 (0x868) cpp_common::SeekableMemoryReadStream stream(buffer, 2); int16_t value = stream.readSint16LE(); std::cout << "Value: " << value << std::endl; // Output: Value: -2040 return 0; }
#includeThis code opens a seekable input stream from a file called data.bin and uses the readSint16LE function to read a signed 16-bit integer from the stream. The resulting value is then printed to the console. This example assumes that the data.bin file contains a little-endian representation of a signed 16-bit integer.int main() { cpp_common::SeekableFileStream stream("data.bin"); int16_t value = stream.readSint16LE(); std::cout << "Value: " << value << std::endl; return 0; }