You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScByteArray.hxx 509B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // Created by robin on 6/27/15.
  3. //
  4. #include <stdlib.h>
  5. #include <string.h>
  6. ScByteArray::ScByteArray()
  7. : _size(0)
  8. , _data(nullptr)
  9. {
  10. }
  11. ScByteArray::ScByteArray(BYTE * const data, const DWORD size)
  12. : _data(data)
  13. , _size(size)
  14. {
  15. }
  16. ScByteArray::ScByteArray(const ScByteArray &data)
  17. {
  18. _size = data._size;
  19. _data = (BYTE*)memcpy(malloc(_size), data._data, _size);
  20. }
  21. ScByteArray::~ScByteArray()
  22. {
  23. delete[] _data;
  24. }
  25. BYTE* ScByteArray::getData() const
  26. {
  27. return _data;
  28. }