| 6 |
| * Copyright Nikolai Kudashov, 2015. |
| 7 | */ |
| 8 |
| 9 | #ifndef BYTESTREAM_H |
| 10 | #define BYTESTREAM_H |
| 11 |
| 12 | #include <vector> |
| 13 | #include <stdint.h> |
| 14 |
| 15 | class NativeByteBuffer; |
| 16 |
| 17 | class ByteStream { |
| 18 |
| 19 | public: |
| 20 | ByteStream(); |
| 21 | ~ByteStream(); |
| 22 | void append(NativeByteBuffer *buffer); |
| 23 | void append(uint8_t *buffer, uint32_t size); |
| 24 | bool hasData(); |
| 25 | void get(NativeByteBuffer *dst); |
| 26 | void discard(uint32_t count); |
| 27 | void clean(); |
| 28 |
| 29 | private: |
| 30 | std::vector<NativeByteBuffer *> buffersQueue; |
| 31 | }; |
| 32 |
| 33 | #endif |
| 34 |