Added StreamReader.h

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@182 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2008-10-18 12:19:28 +00:00
parent 888df37d0f
commit f2c9745b7d
1 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ namespace Assimp
* is known at compile-time. * is known at compile-time.
*/ */
template <bool SwapEndianess = false> template <bool SwapEndianess = false>
class ASSIMP_API StreamReader class StreamReader
{ {
public: public:
@ -109,7 +109,7 @@ public:
*/ */
inline int8_t GetI1() inline int8_t GetI1()
{ {
if (current + 1 >= end) if (current >= end)
throw new ImportErrorException("End of file was reached"); throw new ImportErrorException("End of file was reached");
return *current++; return *current++;
@ -162,7 +162,7 @@ private:
template <typename T> template <typename T>
inline T Get() inline T Get()
{ {
if (current + sizeof(T) >= end) if (current + sizeof(T) > end)
throw new ImportErrorException("End of file was reached"); throw new ImportErrorException("End of file was reached");
T f = *((const T*)current); T f = *((const T*)current);