/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Native method support for java.util.zip.Deflater
*/
#include <stdio.h>
#include <stdlib.h>
#include "jlong.h"
#include "jni.h"
#include "jni_util.h"
#include <zlib.h>
#include "java_util_zip_Deflater.h"
{
}
{
if (strm == 0) {
return jlong_zero;
} else {
char *msg;
DEF_MEM_LEVEL, strategy)) {
case Z_OK:
return ptr_to_jlong(strm);
case Z_MEM_ERROR:
return jlong_zero;
case Z_STREAM_ERROR:
return jlong_zero;
default:
return jlong_zero;
}
}
}
{
int res;
if (buf == 0) {/* out of memory */
return;
}
switch (res) {
case Z_OK:
break;
case Z_STREAM_ERROR:
break;
default:
break;
}
}
{
int res;
// Throw OOME only when length is not zero
if (this_len != 0)
return 0;
}
if (len != 0)
return 0;
}
switch (res) {
case Z_OK:
case Z_BUF_ERROR:
return 0;
default:
return 0;
}
} else {
if (this_len != 0)
return 0;
}
if (len != 0)
return 0;
}
switch (res) {
case Z_STREAM_END:
/* fall through */
case Z_OK:
case Z_BUF_ERROR:
return 0;
default:
return 0;
}
}
}
{
}
{
}
}
{
} else {
}
}