This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
frostbite/snowlib/DataUtil.h
2020-02-06 00:23:46 +00:00

21 lines
391 B
C++

#pragma once
#include <stdint.h>
class DataUtil
{
public:
static int getLEInt(const unsigned char* data, int offset){
return *(int32_t *)(data + offset);
}
static short getLEShort(const unsigned char* data, int offset){
return *(int16_t *)(data + offset);
}
static unsigned short getLEUShort(const unsigned char* data, int offset){
return *(uint16_t *)(data + offset);
}
};