Cleaned up readString
This commit is contained in:
parent
4f1a1c8b16
commit
0d48e62811
@ -297,15 +297,15 @@ std::string DataInputStream::readString()
|
||||
{
|
||||
std::string s;
|
||||
int size = readInt();
|
||||
if (size == 0)
|
||||
return std::string();
|
||||
if (size != 0)
|
||||
{
|
||||
s.resize(size);
|
||||
_istream->read((char*)s.c_str(), size);
|
||||
//if (_istream->rdstate() & _istream->failbit)
|
||||
// throw Exception("DataInputStream::readString(): Failed to read string value.");
|
||||
|
||||
s.resize(size);
|
||||
_istream->read((char*)s.c_str(), size);
|
||||
//if (_istream->rdstate() & _istream->failbit)
|
||||
// throw Exception("DataInputStream::readString(): Failed to read string value.");
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeString() ["<<s<<"]"<<std::endl;
|
||||
if (_verboseOutput) std::cout<<"read/writeString() ["<<s<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user