Work around for OSX errors when reading .ive files.

This commit is contained in:
Robert Osfield
2003-09-12 19:17:46 +00:00
parent 5f4cce549e
commit fe06711c9f
2 changed files with 9 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ using namespace std;
DataInputStream::DataInputStream(std::istream* istream)
{
_verboseOutput = true;
_verboseOutput = false;
_istream = istream;
_peeking = false;
@@ -108,6 +108,7 @@ unsigned short DataInputStream::readUShort(){
unsigned int DataInputStream::readUInt(){
unsigned int s;
_istream->read((char*)&s, INTSIZE);
if (_istream->rdstate() & _istream->failbit)
throw Exception("DataInputStream::readUInt(): Failed to read unsigned int value.");
@@ -123,8 +124,12 @@ int DataInputStream::readInt(){
}
int i;
_istream->read((char*)&i, INTSIZE);
if (_istream->rdstate() & _istream->failbit)
throw Exception("DataInputStream::readInt(): Failed to read int value.");
// comment out for time being as this check seems to eroneously cause a
// premature exit when reading .ive files under OSX!#?:!
// Robet Osfield, September 12th 2003.
// if (_istream->rdstate() & _istream->failbit)
// throw Exception("DataInputStream::readInt(): Failed to read int value.");
if (_verboseOutput) std::cout<<"read/writeInt() ["<<i<<"]"<<std::endl;

View File

@@ -49,7 +49,7 @@ using namespace ive;
DataOutputStream::DataOutputStream(std::ostream * ostream)
{
_verboseOutput = true;
_verboseOutput = false;
_includeImageData= true;
_ostream = ostream;