Add access methods for getting at the JPEG buffer
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@506 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
index 6b8592f..5515353 100644
--- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
@@ -71,6 +71,16 @@
return jpegSubsamp;
}
+ public byte[] getJPEGBuf() throws Exception {
+ if(jpegBuf == null) throw new Exception("JPEG buffer not initialized");
+ return jpegBuf;
+ }
+
+ public int getJPEGSize() throws Exception {
+ if(jpegBufSize < 1) throw new Exception("JPEG buffer not initialized");
+ return jpegBufSize;
+ }
+
public int getScaledWidth(int desiredWidth, int desiredHeight)
throws Exception {
if(jpegWidth < 1 || jpegHeight < 1)