ByteStream.h 504 B

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