diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-01 22:42:19 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-01 23:09:05 +0800 |
commit | e88785ca6a6a37a6a1828fa1df436d98e39ec2be (patch) | |
tree | 34f2eb13eb301389cb52052a474ae781a1b9bcb3 /platform | |
parent | b1a4f1a198fa568f0e72526161295d4287fee10b (diff) | |
download | mupdf-e88785ca6a6a37a6a1828fa1df436d98e39ec2be.tar.xz |
JNI: Update to new pdf_load_stream interface.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/java/mupdf_native.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 7759a7d0..8413cbb7 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -6522,7 +6522,6 @@ FUN(PDFObject_readStream)(JNIEnv *env, jobject self) { fz_context *ctx = get_context(env); pdf_obj *obj = from_PDFObject(env, self); - pdf_document *pdf = NULL; fz_buffer *buf = NULL; jbyteArray arr = NULL; @@ -6533,10 +6532,7 @@ FUN(PDFObject_readStream)(JNIEnv *env, jobject self) fz_try(ctx) { - if (!pdf_is_stream(ctx, obj)) - fz_throw(ctx, FZ_ERROR_GENERIC, "not a stream"); - pdf = pdf_get_indirect_document(ctx, obj); - buf = pdf_load_stream(ctx, pdf, pdf_to_num(ctx, obj)); + buf = pdf_load_stream(ctx, obj); arr = (*env)->NewByteArray(env, buf->len); if (arr == NULL) @@ -6560,7 +6556,6 @@ FUN(PDFObject_readRawStream)(JNIEnv *env, jobject self) { fz_context *ctx = get_context(env); pdf_obj *obj = from_PDFObject(env, self); - pdf_document *pdf = NULL; fz_buffer *buf = NULL; jbyteArray arr = NULL; @@ -6571,10 +6566,7 @@ FUN(PDFObject_readRawStream)(JNIEnv *env, jobject self) fz_try(ctx) { - if (!pdf_is_stream(ctx, obj)) - fz_throw(ctx, FZ_ERROR_GENERIC, "not a stream"); - pdf = pdf_get_indirect_document(ctx, obj); - buf = pdf_load_raw_stream(ctx, pdf, pdf_to_num(ctx, obj)); + buf = pdf_load_raw_stream(ctx, obj); arr = (*env)->NewByteArray(env, buf->len); if (arr == NULL) |