ByteArray.h 595 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * This is the source code of tgnet library v. 1.1
  3. * It is licensed under GNU GPL v. 2 or later.
  4. * You should have received a copy of the license in this archive (see LICENSE).
  5. *
  6. * Copyright Nikolai Kudashov, 2015-2018.
  7. */
  8. #ifndef BYTEARRAY_H
  9. #define BYTEARRAY_H
  10. #include <stdint.h>
  11. class ByteArray {
  12. public:
  13. ByteArray();
  14. ByteArray(uint32_t len);
  15. ByteArray(ByteArray *byteArray);
  16. ByteArray(uint8_t *buffer, uint32_t len);
  17. ~ByteArray();
  18. void alloc(uint32_t len);
  19. uint32_t length;
  20. uint8_t *bytes;
  21. bool isEqualTo(ByteArray *byteArray);
  22. };
  23. #endif