Lines Matching refs:buff
240 uint32_t ReadLE32(const uint8_t *buff)
242 if (buff == nullptr) {
243 PKG_LOGE("buff is null");
247 uint32_t value32 = buff[0];
249 value32 += static_cast<uint32_t>(static_cast<uint32_t>(buff[1]) << offset);
251 value32 += static_cast<uint32_t>(static_cast<uint32_t>(buff[SECOND_BUFFER]) << offset);
253 value32 += static_cast<uint32_t>(static_cast<uint32_t>(buff[THIRD_BUFFER]) << offset);
257 uint64_t ReadLE64(const uint8_t *buff)
259 if (buff == nullptr) {
260 PKG_LOGE("buff is null");
263 uint32_t low = ReadLE32(buff);
264 uint32_t high = ReadLE32(buff + sizeof(uint32_t));
269 void WriteLE32(uint8_t *buff, uint32_t value)
271 if (buff == nullptr) {
272 PKG_LOGE("buff is null");
276 buff[0] = static_cast<uint8_t>(value);
278 buff[1] = static_cast<uint8_t>(value >> offset);
280 buff[SECOND_BUFFER] = static_cast<uint8_t>(value >> offset);
282 buff[THIRD_BUFFER] = static_cast<uint8_t>(value >> offset);
285 uint16_t ReadLE16(const uint8_t *buff)
287 if (buff == nullptr) {
288 PKG_LOGE("buff is null");
291 uint16_t value16 = buff[0];
292 value16 += static_cast<uint16_t>(buff[1] << BYTE_SIZE);
296 void WriteLE16(uint8_t *buff, uint16_t value)
298 if (buff == nullptr) {
299 PKG_LOGE("buff is null");
302 buff[0] = static_cast<uint8_t>(value);
303 buff[1] = static_cast<uint8_t>(value >> BYTE_SIZE);