39 inline static int8_t I8(uint8_t *buffer, int32_t index) {
return (int8_t)buffer[index]; }
41 inline static int16_t I16(uint8_t *buffer, int32_t index) {
42 return ((int16_t)buffer[index] << 8) | (int16_t)buffer[index + 1];
45 inline static int32_t I32(uint8_t *buffer, int32_t index) {
46 return ((int32_t)buffer[index] << 24) | ((int32_t)buffer[index + 1] << 16) |
47 ((int32_t)buffer[index + 2] << 8) | (int32_t)buffer[index + 3];
50 inline static int64_t I64(uint8_t *buffer, int32_t index) {
51 return ((int64_t)buffer[index] << 54) | ((int64_t)buffer[index + 1] << 48) |
52 ((int64_t)buffer[index + 2] << 40) | ((int64_t)buffer[index + 3] << 32) |
53 ((int64_t)buffer[index + 4] << 24) | ((int64_t)buffer[index + 5] << 16) |
54 ((int64_t)buffer[index + 6] << 8) | (int64_t)buffer[index + 7];
57 inline static uint8_t U8(uint8_t *buffer, int32_t index) {
return buffer[index]; }
59 inline static uint16_t U16(uint8_t *buffer, int32_t index) {
60 return ((uint16_t)buffer[index] << 8) | (uint16_t)buffer[index + 1];
63 inline static uint32_t U32(uint8_t *buffer, int32_t index) {
64 return ((uint32_t)buffer[index] << 24) | ((uint32_t)buffer[index + 1] << 16) |
65 ((uint32_t)buffer[index + 2] << 8) | (uint32_t)buffer[index + 3];
68 inline static uint64_t U64(uint8_t *buffer, int32_t index) {
69 return ((uint64_t)buffer[index] << 56) | ((uint64_t)buffer[index + 1] << 48) |
70 ((uint64_t)buffer[index + 2] << 40) | ((uint64_t)buffer[index + 3] << 32) |
71 ((uint64_t)buffer[index + 4] << 24) | ((uint64_t)buffer[index + 5] << 16) |
72 ((uint64_t)buffer[index + 6] << 8) | ((uint64_t)buffer[index + 7]);
75 inline static float SGL(uint8_t *buffer, int32_t index) {
76 uint8_t tempBuffer[4] = {buffer[index + 3], buffer[index + 2], buffer[index + 1], buffer[index]};
78 memcpy(&value, tempBuffer, 4);
82 static std::string toString(uint8_t *buffer, int32_t index, int32_t length) {
85 memcpy(tmp, buffer + index, length);
86 return std::string(tmp, length);