#include namespace dmtools::io { struct MemoryStream : public Stream { MemoryStream(u8* memory, usize size); virtual ~MemoryStream(); StreamDiff ReadSome(u8* buffer, usize length) override; StreamDiff WriteSome(const u8* buffer, usize length) override; StreamDiff Seek(StreamDiff where, StreamSeekDirection dir) override; StreamDiff Tell() const override; bool Ok() const override; bool Eof() const override; private: u8* beg; u8* cur; u8* end; usize size; }; }