2
0

ByteStream.h 525 B

123456789101112131415161718192021222324252627
  1. #ifndef BELL_BYTE_READER_H
  2. #define BELL_BYTE_READER_H
  3. #include <stdlib.h>
  4. #include <stdint.h>
  5. /**
  6. * A class for reading bytes from a stream. Further implemented in HTTPStream.h
  7. */
  8. namespace bell
  9. {
  10. class ByteStream
  11. {
  12. public:
  13. ByteStream(){};
  14. ~ByteStream(){};
  15. virtual size_t read(uint8_t *buf, size_t nbytes) = 0;
  16. virtual size_t skip(size_t nbytes) = 0;
  17. virtual size_t position() = 0;
  18. virtual size_t size() = 0;
  19. virtual void close() = 0;
  20. };
  21. }
  22. #endif