11 #ifndef _SMING_CORE_DATA_STREAM_LIMITED_MEMORY_STREAM_H_ 12 #define _SMING_CORE_DATA_STREAM_LIMITED_MEMORY_STREAM_H_ 14 #include "ReadWriteStream.h" 48 return writePos - readPos;
54 bool seek(
int len)
override;
61 size_t write(
const uint8_t* buffer,
size_t size)
override;
65 return (readPos >= length);
69 uint8_t* buffer =
nullptr;
StreamType getStreamType() const override
Get the stream type.
Definition: LimitedMemoryStream.h:37
Memory data stream.
Definition: DataSourceStream.h:24
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.
int available() override
Return the total length of the stream.
Definition: LimitedMemoryStream.h:46
bool seek(int len) override
Move read cursor.
size_t write(const uint8_t *buffer, size_t size) override
Write chars to stream.
StreamType
Data stream type.
Definition: DataSourceStream.h:22
bool isFinished() override
Check if all data has been read.
Definition: LimitedMemoryStream.h:63
Memory stream that stores limited number of bytes Once the limit is reached the stream will discard i...
Definition: LimitedMemoryStream.h:24
Base class for read/write stream.
Definition: ReadWriteStream.h:23
int length() SMING_DEPRECATED
Return the total length of the stream.
Definition: DataSourceStream.h:114