24 uint8_t *
data(
size_t offset = 0);
38 size_t resize(
size_t size);
An STL allocator that uses SPI or internal RAM.
void deallocate(T *p, size_t n)
Buffer for managing downloaded data.
DownloadBuffer(size_t size)
size_t unread_
Total number of downloaded bytes not yet read.
size_t free_capacity() const
bool grow(size_t size)
Make the buffer at least size bytes, keeping the unread data. Returns false if the allocation failed.
uint8_t * data(size_t offset=0)
size_t resize(size_t size)
Lets a decoder read a download as it arrives, from the download buffer.
void compact()
Drop the bytes the decoder has read, to make room for more of the download.
DownloadSource(DownloadBuffer &buffer)
int32_t read(uint8_t *buf, uint32_t len) override
void set_keep_read(bool keep)
bool seek(uint32_t position) override
void reset()
Start again at the beginning of a new download, keeping what is read.
Input that a decoder reads itself as it goes, so the whole image never has to be in memory at once.