From f4edb2ec6d6d436581afaef7ca0b982b3d7be79e Mon Sep 17 00:00:00 2001 From: Daven Sanassy Date: Wed, 9 Mar 2016 17:03:21 +0000 Subject: [PATCH] Add clear function to BinaryStream -Simply allow istream clear function to be called from Binary Stream -This is necessary for putting the stream back into a good (reusable) state after eof has been hit --- source/MP4.BinaryStream.cpp | 5 +++++ source/include/MP4.BinaryStream.h | 1 + 2 files changed, 6 insertions(+) diff --git a/source/MP4.BinaryStream.cpp b/source/MP4.BinaryStream.cpp index 05196f3..c70aec3 100644 --- a/source/MP4.BinaryStream.cpp +++ b/source/MP4.BinaryStream.cpp @@ -605,3 +605,8 @@ std::istream & BinaryStream::seekg( std::streamoff off, std::ios_base::seekdir d { return stream.seekg( off, dir ); } + +void BinaryStream::clear( void ) +{ + return stream.clear(); +} diff --git a/source/include/MP4.BinaryStream.h b/source/include/MP4.BinaryStream.h index 6857e1f..c64c1b2 100644 --- a/source/include/MP4.BinaryStream.h +++ b/source/include/MP4.BinaryStream.h @@ -129,6 +129,7 @@ namespace MP4 std::istream & unget( void ); std::istream & seekg( std::streampos pos ); std::istream & seekg( std::streamoff off, std::ios_base::seekdir dir ); + void clear( void ); }; }