diff options
Diffstat (limited to 'common/stream.cpp')
-rw-r--r-- | common/stream.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/stream.cpp b/common/stream.cpp index 45060b9db5..08774312fd 100644 --- a/common/stream.cpp +++ b/common/stream.cpp @@ -247,6 +247,19 @@ uint32 SafeSeekableSubReadStream::read(void *dataPtr, uint32 dataSize) { return SeekableSubReadStream::read(dataPtr, dataSize); } +void SeekableReadStream::hexdump(int len, int bytesPerLine, int startOffset) { + uint pos_ = pos(); + uint size_ = size(); + uint toRead = MIN<uint>(len + startOffset, size_ - pos_); + byte *data = (byte *)calloc(toRead, 1); + + read(data, toRead); + Common::hexdump(data, toRead, bytesPerLine, startOffset); + + free(data); + + seek(pos_); +} #pragma mark - @@ -500,6 +513,8 @@ public: virtual bool flush() { return flushBuffer(); } + virtual int32 pos() const { return _pos; } + }; } // End of anonymous namespace |