Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ByteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class ByteBuffer
ByteBuffer& position(uint32_t newPosition)
{
position_ = newPosition;
return *this;
}

void printInfo() const
Expand All @@ -367,7 +368,9 @@ class ByteBuffer
if (!p_buffer_ || index + sizeof(T) > limit_)
return 0;

return *((T*)&p_buffer_[index]);
T data;
std::memcpy(&data, &p_buffer_[index], sizeof(T));
return data;
}

template <typename T>
Expand Down