1428N/A int overrun(int itemSize, int nItems);
1428N/A- void checkCompressionLevel();
1428N/A level = -1; // Z_DEFAULT_COMPRESSION
1428N/A+ if (newLevel != compressionLevel) {
1428N/A+ if (deflateParams (zs, newLevel, Z_DEFAULT_STRATEGY) != Z_OK)
1428N/A+ throw Exception("ZlibOutStream: deflateParams failed");
1428N/A+ compressionLevel = newLevel;
1428N/A int ZlibOutStream::length()
1428N/A // fprintf(stderr,"zos flush: calling deflate, avail_in %d, avail_out %d\n",
1428N/A // zs->avail_in,zs->avail_out);
1428N/A- int rc = deflate(zs, Z_SYNC_FLUSH);
1428N/A- if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
1428N/A+ int rc = deflate(zs, Z_SYNC_FLUSH);
1428N/A+ throw Exception("ZlibOutStream: deflate failed");
1428N/A // fprintf(stderr,"zos flush: after deflate: %d bytes\n",
1428N/A // zs->next_out-underlying->getptr());
1428N/A // fprintf(stderr,"zos overrun: calling deflate, avail_in %d, avail_out %d\n",
1428N/A // zs->avail_in,zs->avail_out);
1428N/A- if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
1428N/A+ int rc = deflate(zs, Z_SYNC_FLUSH);
1428N/A+ throw Exception("ZlibOutStream: deflate failed");
1428N/A // fprintf(stderr,"zos overrun: after deflate: %d bytes\n",
1428N/A // zs->next_out-underlying->getptr());
1428N/A nItems = (end - ptr) / itemSize;
1428N/A-void ZlibOutStream::checkCompressionLevel()
1428N/A- if (newLevel != compressionLevel) {
1428N/A- // This is a horrible hack, but after many hours of trying, I couldn't find
1428N/A- // a better way to make this class work properly with both Zlib 1.2.3 and
1428N/A- // 1.2.5. 1.2.3 does a Z_PARTIAL_FLUSH in the body of deflateParams() if
1428N/A- // the compression level has changed, and 1.2.5 does a Z_BLOCK flush.
1428N/A- int rc = deflate(zs, Z_SYNC_FLUSH);
1428N/A- if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
1428N/A- if (deflateParams (zs, newLevel, Z_DEFAULT_STRATEGY) != Z_OK) {
1428N/A- throw Exception("ZlibOutStream: deflateParams failed");
1428N/A- compressionLevel = newLevel;