if ( !out )
throw(streamException(out.rdstate()));
- if ( out.write(uncompressed.get_base(), uncompressed.content_sz()) == 0 )
+ out.write(uncompressed.get_base(), uncompressed.content_sz());
+ if ( out.bad() )
throw(streamException(out.rdstate()));
out.close();
compressed.expand_chunk(x);
- if ( in.read(compressed.get_base(), x) == 0 || x != in.gcount() )
+ in.read(compressed.get_base(), x);
+ if ( in.bad() || x != in.gcount() )
throw(streamException(in.rdstate()));
compressed.set_content_sz(x);
if ( !out )
throw(streamException(out.rdstate()));
- if ( out.write(compressed.get_base(), compressed.content_sz()) == 0 )
+ out.write(compressed.get_base(), compressed.content_sz());
+ if ( out.bad() )
throw(streamException(out.rdstate()));
out.close();
uncompressed.expand_chunk(x);
- if ( in.read(uncompressed.get_base(), x) == 0 || x != in.gcount() )
+ in.read(uncompressed.get_base(), x);
+ if ( in.bad() || x != in.gcount() )
throw(streamException(in.rdstate()));
uncompressed.set_content_sz(x);
int offset = int(loc) + str_off;
- if ( seekg( offset, ios::beg ) == 0 ) {
+ seekg( offset, ios::beg );
+ if ( bad() ) {
MESSAGE(cerr, "seekg failed");
throw(streamException(fstream::rdstate()));
}
- if ( read( base, len ) == 0 || len != fstream::gcount() ) {
+ read( base, len );
+ if ( bad() || len != fstream::gcount() ) {
MESSAGE(cerr, "read() failed");
throw(streamException(fstream::rdstate()));
}