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.

22 lines
422 B

4 years ago
  1. #pragma once
  2. typedef unsigned char Byte;
  3. class CArrayBuffer {
  4. public:
  5. CArrayBuffer(int byteLength = 8) {
  6. this->_byteLenght = byteLength;
  7. this->pData = new Byte[this->_byteLenght];
  8. }
  9. ~CArrayBuffer() {
  10. if (this->pData != nullptr) {
  11. delete[] this->pData;
  12. this->pData = nullptr;
  13. }
  14. }
  15. int byteLength() {
  16. return this->_byteLenght;
  17. }
  18. public:
  19. Byte *pData;
  20. private:
  21. int _byteLenght;
  22. };