diff options
Diffstat (limited to 'common/stream.cpp')
-rw-r--r-- | common/stream.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/stream.cpp b/common/stream.cpp index a8446a9086..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 - |