commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1158361 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/util/bzip2/ native/shared/
Date Tue, 16 Aug 2011 16:33:47 GMT
Author: mturk
Date: Tue Aug 16 16:33:47 2011
New Revision: 1158361

URL: http://svn.apache.org/viewvc?rev=1158361&view=rev
Log:
Use less cryptic api names

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Impl.java
      - copied, changed from r1158328, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Libbzip2.java
Removed:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Libbzip2.java
Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Deflater.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Inflater.java
    commons/sandbox/runtime/trunk/src/main/native/shared/bzip2.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2.java?rev=1158361&r1=1158360&r2=1158361&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2.java
Tue Aug 16 16:33:47 2011
@@ -100,37 +100,37 @@ public final class Bzip2
         // No instance
     }
 
-    private static native int  b2bdeflate0(byte[] src, int spos,
-                                           byte[] dst, int dpos, int dlen,
-                                           int len, int blockSize100k,
-                                           int workFactor)
+    private static native int  deflate0(byte[] src, int spos,
+                                        byte[] dst, int dpos, int dlen,
+                                        int len, int blockSize100k,
+                                        int workFactor)
         throws InvalidArgumentException,
                OverflowException;
-    private static native int  b2bdeflate1(ByteBuffer src, int spos,
+    private static native int  deflate1(ByteBuffer src, int spos,
                                            ByteBuffer dst, int dpos, int dlen,
                                            int len, int blockSize100k,
                                            int workFactor)
         throws InvalidArgumentException,
                OverflowException;
-    private static native long b2bdeflate2(long src, long dst, long dlen,
+    private static native long deflate2(long src, long dst, long dlen,
                                            long len, int blockSize100k,
                                            int workFactor)
         throws InvalidArgumentException,
                InvalidRangeException,
                OverflowException;
-    private static native int  b2binflate0(byte[] src, int spos,
+    private static native int  inflate0(byte[] src, int spos,
                                            byte[] dst, int dpos, int dlen,
                                            int len, boolean small)
         throws InvalidArgumentException,
                InvalidDataException,
                OverflowException;
-    private static native int  b2binflate1(ByteBuffer src, int spos,
+    private static native int  inflate1(ByteBuffer src, int spos,
                                            ByteBuffer dst, int dpos, int dlen,
                                            int len, boolean small)
         throws InvalidArgumentException,
                InvalidDataException,
                OverflowException;
-    private static native long b2binflate2(long src,long dst, long dlen,
+    private static native long inflate2(long src,long dst, long dlen,
                                            long len, boolean small)
         throws InvalidArgumentException,
                InvalidDataException,
@@ -180,8 +180,8 @@ public final class Bzip2
         if (srcPos < 0  || destPos < 0 || destLen < 1 || length < 1 ||
             srcPos + length > src.length)
             throw new ArrayIndexOutOfBoundsException();
-        return b2bdeflate0(src, srcPos, dest, destPos, destLen,
-                           length, blockSize100k, workFactor);
+        return deflate0(src, srcPos, dest, destPos, destLen,
+                        length, blockSize100k, workFactor);
     }
 
     /**
@@ -195,7 +195,7 @@ public final class Bzip2
      * </p>
      *
      * @param src the source data buffer.
-     * @param dest destination buffer that will hold compressed data.
+     * @param dst destination buffer that will hold compressed data.
      * @param blockSize100k the block size to be used for compression. It
      *          should be a value between {@code 1} and {@code 9} inclusive.
      * @param workFactor controls how the compression phase behaves when
@@ -207,7 +207,7 @@ public final class Bzip2
      *          the size of the destination buffer.
      */
     public static void buffToBuffCompress(ByteBuffer src,
-                                          ByteBuffer dest,
+                                          ByteBuffer dst,
                                           int blockSize100k,
                                           int workFactor)
         throws InvalidArgumentException,
@@ -215,10 +215,13 @@ public final class Bzip2
     {
         if (blockSize100k < 1 || blockSize100k > 9 || workFactor < 0 || workFactor
> 250)
             throw new InvalidArgumentException();
-        int s = b2bdeflate1(src, src.position(), dest, dest.position(),
-                            dest.limit(), src.limit(),
-                            blockSize100k, workFactor);
-        dest.position(s);
+        int dstLen = dst.limit() - dst.position();
+        int length = src.limit() - src.position();
+        if (dstLen < 1 || length < 1)
+            throw new ArrayIndexOutOfBoundsException();          
+        int s = deflate1(src, src.position(), dst, dst.position(),
+                         dstLen, length, blockSize100k, workFactor);
+        dst.position(s);
     }
 
     /**
@@ -265,8 +268,7 @@ public final class Bzip2
         long dlen = dst.sizeof()  - dstPos;
         if (dlen < 1L || srcPos < 0L || dstPos < 0L)
             throw new IndexOutOfBoundsException();
-        return b2bdeflate2(srca, dsta, dlen, length,
-                           blockSize100k, workFactor);
+        return deflate2(srca, dsta, dlen, length, blockSize100k, workFactor);
     }
 
     /**
@@ -309,7 +311,7 @@ public final class Bzip2
         if (srcPos < 0  || destPos < 0 || destLen < 1 || length < 1 ||
             srcPos + length > src.length)
             throw new ArrayIndexOutOfBoundsException();
-        return b2binflate0(src, srcPos, dest, destPos, destLen, length, small);
+        return inflate0(src, srcPos, dest, destPos, destLen, length, small);
     }
 
     /**
@@ -323,7 +325,7 @@ public final class Bzip2
      * </p>
      *
      * @param src the source data buffer.
-     * @param dest destination buffer that will hold uncompressed data.
+     * @param dst destination buffer that will hold uncompressed data.
      * @param small if {@code true} the library will use an alternative
      *          decompression algorithm which uses less memory but at the cost
      *          of decompressing more slowly.
@@ -335,16 +337,19 @@ public final class Bzip2
      *          the size of the destination buffer.
      */
     public static void buffToBuffDecompress(ByteBuffer src,
-                                     ByteBuffer dest,
+                                     ByteBuffer dst,
                                      boolean small)
         throws InvalidArgumentException,
                InvalidDataException,
                OverflowException
     {
-        /* TODO: Check for param validity */
-        int p = b2binflate1(src, src.position(), dest, dest.position(),
-                            dest.limit(), src.limit(), small);
-        dest.position(p);
+        int dstLen = dst.limit() - dst.position();
+        int length = src.limit() - src.position();
+        if (dstLen < 1 || length < 1)
+            throw new ArrayIndexOutOfBoundsException();
+        int p = inflate1(src, src.position(), dst, dst.position(),
+                         dstLen, length, small);
+        dst.position(p);
     }
 
     /**
@@ -389,7 +394,7 @@ public final class Bzip2
         if (dlen < 1L || srcPos < 0L || dstPos < 0L)
             throw new IndexOutOfBoundsException();
         /* TODO: Check for param validity */
-        return b2binflate2(srca, dsta, dlen, length, small);
+        return inflate2(srca, dsta, dlen, length, small);
     }
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Deflater.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Deflater.java?rev=1158361&r1=1158360&r2=1158361&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Deflater.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Deflater.java
Tue Aug 16 16:33:47 2011
@@ -94,9 +94,9 @@ public class Bzip2Deflater extends Defla
         if (workFactor < 0 || workFactor > 250)
             throw new InvalidArgumentException();
         if (workFactor == 0)
-            workFactor = Libbzip2.DEFAULT_WORK_FACTOR;
-        handle = Libbzip2.newStream(bufferSize);
-        int rc = Libbzip2.compressInit(handle, blockSize100k, workFactor);
+            workFactor = Bzip2Impl.DEFAULT_WORK_FACTOR;
+        handle = Bzip2Impl.newStream(bufferSize);
+        int rc = Bzip2Impl.compressInit(handle, blockSize100k, workFactor);
         if (rc != 0)
             throw new OutOfMemoryError();
     }
@@ -105,7 +105,6 @@ public class Bzip2Deflater extends Defla
     public synchronized void close()
         throws IOException
     {
-        System.out.println("Closing deflater " + handle);
         if (handle != 0L) {
             close0(handle);
             handle = 0L;
@@ -117,7 +116,7 @@ public class Bzip2Deflater extends Defla
     {
         if (handle == 0L)
             throw new IllegalStateException();
-        return Libbzip2.needsInput(handle);
+        return Bzip2Impl.needsInput(handle);
     }
 
     @Override
@@ -125,7 +124,7 @@ public class Bzip2Deflater extends Defla
     {
         if (handle == 0L)
             throw new IllegalStateException();
-        return Libbzip2.finished(handle);
+        return Bzip2Impl.finished(handle);
     }
 
     @Override
@@ -138,7 +137,7 @@ public class Bzip2Deflater extends Defla
             throw new ArrayIndexOutOfBoundsException();
         if (handle == 0L)
             throw new IllegalStateException();
-        Libbzip2.setInput0(handle, b, off, len);
+        Bzip2Impl.setInput0(handle, b, off, len);
     }
 
     @Override
@@ -150,7 +149,7 @@ public class Bzip2Deflater extends Defla
             throw new InvalidArgumentException();
         if (handle == 0L)
             throw new IllegalStateException();
-        Libbzip2.setInput1(handle, b, b.position(), len);
+        Bzip2Impl.setInput1(handle, b, b.position(), len);
     }
 
     @Override
@@ -163,7 +162,7 @@ public class Bzip2Deflater extends Defla
             throw new IndexOutOfBoundsException();
         if (handle == 0L)
             throw new IllegalStateException();
-        Libbzip2.setInput2(handle, b.address() + off, len);
+        Bzip2Impl.setInput2(handle, b.address() + off, len);
     }
 
     @Override
@@ -171,7 +170,7 @@ public class Bzip2Deflater extends Defla
     {
         if (handle == 0L)
             throw new IllegalStateException();
-        return Libbzip2.getTotalIn(handle);
+        return Bzip2Impl.getTotalIn(handle);
     }
 
     @Override
@@ -179,7 +178,7 @@ public class Bzip2Deflater extends Defla
     {
         if (handle == 0L)
             throw new IllegalStateException();
-        return Libbzip2.getTotalOut(handle);
+        return Bzip2Impl.getTotalOut(handle);
     }
 
     @Override
@@ -188,7 +187,7 @@ public class Bzip2Deflater extends Defla
     {
         if (handle == 0L)
             throw new IllegalStateException();
-        if (!Libbzip2.finish(handle))
+        if (!Bzip2Impl.finish(handle))
             throw new IllegalStateException();
     }
    
@@ -198,7 +197,7 @@ public class Bzip2Deflater extends Defla
     {
         if (handle == 0L)
             throw new IllegalStateException();
-        if (!Libbzip2.flush(handle))
+        if (!Bzip2Impl.flush(handle))
             throw new IllegalStateException();
     }
         

Copied: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Impl.java
(from r1158328, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Libbzip2.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Impl.java?p2=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Impl.java&p1=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Libbzip2.java&r1=1158328&r2=1158361&rev=1158361&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Libbzip2.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Impl.java
Tue Aug 16 16:33:47 2011
@@ -33,7 +33,7 @@ import org.apache.commons.runtime.util.S
  * @author Mladen Turk
  * @since Runtime 1.0
  */
-final class Libbzip2
+final class Bzip2Impl
 {
 
     /**
@@ -77,6 +77,10 @@ final class Libbzip2
     static {
         SIZEOF_BZ_STREAM = bzsize0();       
     }
-    
+
+    private Bzip2Impl()
+    {
+        // No instance
+    }
 }
 

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Inflater.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Inflater.java?rev=1158361&r1=1158360&r2=1158361&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Inflater.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/bzip2/Bzip2Inflater.java
Tue Aug 16 16:33:47 2011
@@ -85,8 +85,8 @@ public final class Bzip2Inflater extends
     {
         if (bufferSize < 0)
             throw new InvalidArgumentException();
-        handle = Libbzip2.newStream(bufferSize);
-        int rc = Libbzip2.decompressInit(handle, small);
+        handle = Bzip2Impl.newStream(bufferSize);
+        int rc = Bzip2Impl.decompressInit(handle, small);
     }
 
     @Override
@@ -102,13 +102,13 @@ public final class Bzip2Inflater extends
     @Override
     public synchronized boolean needsInput()
     {
-        return Libbzip2.needsInput(handle);
+        return Bzip2Impl.needsInput(handle);
     }
 
     @Override
     public synchronized boolean finished()
     {
-        return Libbzip2.finished(handle);
+        return Bzip2Impl.finished(handle);
     }
 
     @Override
@@ -119,7 +119,7 @@ public final class Bzip2Inflater extends
             throw new InvalidArgumentException();
         if (off < 0 || off + len > b.length)
             throw new ArrayIndexOutOfBoundsException();
-        Libbzip2.setInput0(handle, b, off, len);
+        Bzip2Impl.setInput0(handle, b, off, len);
     }
 
     @Override
@@ -129,7 +129,7 @@ public final class Bzip2Inflater extends
         int len = b.limit() - b.position();
         if (len < 1)
             throw new InvalidArgumentException();
-        Libbzip2.setInput1(handle, b, b.position(), len);
+        Bzip2Impl.setInput1(handle, b, b.position(), len);
     }
 
     @Override
@@ -140,19 +140,19 @@ public final class Bzip2Inflater extends
             throw new InvalidArgumentException();
         if (off < 0L || off + len > b.sizeof())
             throw new IndexOutOfBoundsException();
-        Libbzip2.setInput2(handle, b.address() + off, len);
+        Bzip2Impl.setInput2(handle, b.address() + off, len);
     }
 
     @Override
     public synchronized long getTotalIn()
     {
-        return Libbzip2.getTotalIn(handle);
+        return Bzip2Impl.getTotalIn(handle);
     }
 
     @Override
     public synchronized long getTotalOut()
     {
-        return Libbzip2.getTotalOut(handle);
+        return Bzip2Impl.getTotalOut(handle);
     }
 
     @Override

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/bzip2.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/bzip2.c?rev=1158361&r1=1158360&r2=1158361&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/bzip2.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/bzip2.c Tue Aug 16 16:33:47 2011
@@ -64,10 +64,10 @@ ACR_BZIP2_EXPORT(jstring, Bzip2, version
     return AcrNewJavaStringU(env, BZ2_bzlibVersion());
 }
 
-ACR_BZIP2_EXPORT(jlong, Bzip2, b2bdeflate0)(JNI_STDARGS, jbyteArray src, jint spos,
-                                            jbyteArray dst, jint dpos, jint dlen,
-                                            jint len, jint blockSize100k,
-                                            jint workFactor)
+ACR_BZIP2_EXPORT(jlong, Bzip2, deflate0)(JNI_STDARGS, jbyteArray src, jint spos,
+                                         jbyteArray dst, jint dpos, jint dlen,
+                                         jint len, jint blockSize100k,
+                                         jint workFactor)
 {
     unsigned int dstLen;
     char *scp;
@@ -99,10 +99,10 @@ ACR_BZIP2_EXPORT(jlong, Bzip2, b2bdeflat
     return 0;
 }
 
-ACR_BZIP2_EXPORT(jint, Bzip2, b2bdeflate1)(JNI_STDARGS, jobject src, jint spos,
-                                           jobject dst, jint dpos, jint dlen,
-                                           jint len, jint blockSize100k,
-                                           jint workFactor)
+ACR_BZIP2_EXPORT(jint, Bzip2, deflate1)(JNI_STDARGS, jobject src, jint spos,
+                                        jobject dst, jint dpos, jint dlen,
+                                        jint len, jint blockSize100k,
+                                        jint workFactor)
 {
     unsigned int dstLen;
     char *scp;
@@ -131,9 +131,9 @@ ACR_BZIP2_EXPORT(jint, Bzip2, b2bdeflate
     return 0;
 }
 
-ACR_BZIP2_EXPORT(jlong, Bzip2, b2bdeflate2)(JNI_STDARGS, jlong src, jlong dst,
-                                            jlong dlen, jlong len, jint blockSize100k,
-                                            jint workFactor)
+ACR_BZIP2_EXPORT(jlong, Bzip2, deflate2)(JNI_STDARGS, jlong src, jlong dst,
+                                         jlong dlen, jlong len, jint blockSize100k,
+                                         jint workFactor)
 {
     unsigned int dstLen;
     char *scp = J2P(src, char *);
@@ -158,9 +158,9 @@ ACR_BZIP2_EXPORT(jlong, Bzip2, b2bdeflat
     return 0;
 }
 
-ACR_BZIP2_EXPORT(jint, Bzip2, b2binflate0)(JNI_STDARGS, jbyteArray src, jint spos,
-                                           jbyteArray dst, jint dpos, jint dlen,
-                                           jint len, jboolean small)
+ACR_BZIP2_EXPORT(jint, Bzip2, inflate0)(JNI_STDARGS, jbyteArray src, jint spos,
+                                        jbyteArray dst, jint dpos, jint dlen,
+                                        jint len, jboolean small)
 {
     unsigned int dstLen;
     char *scp;
@@ -177,7 +177,8 @@ ACR_BZIP2_EXPORT(jint, Bzip2, b2binflate
         return 0;
     }
 
-    rc = BZ2_bzBuffToBuffDecompress(dcp + dpos, &dstLen, scp + spos, len, small, 0);
+    rc = BZ2_bzBuffToBuffDecompress(dcp + dpos, &dstLen,
+                                    scp + spos, len, small, 0);
     RELEASE_CRITICAL(src, scp);
     RELEASE_CRITICAL(dst, dcp);
     if (rc == BZ_OK)
@@ -193,9 +194,9 @@ ACR_BZIP2_EXPORT(jint, Bzip2, b2binflate
     return 0;
 }
 
-ACR_BZIP2_EXPORT(jint, Bzip2, b2binflate1)(JNI_STDARGS, jobject src, jint spos,
-                                           jobject dst, jint dpos, jint dlen,
-                                           jint len, jboolean small)
+ACR_BZIP2_EXPORT(jint, Bzip2, inflate1)(JNI_STDARGS, jobject src, jint spos,
+                                        jobject dst, jint dpos, jint dlen,
+                                        jint len, jboolean small)
 {
     unsigned int dstLen;
     char *scp;
@@ -212,7 +213,8 @@ ACR_BZIP2_EXPORT(jint, Bzip2, b2binflate
         return 0;
     }
 
-    rc = BZ2_bzBuffToBuffDecompress(dcp + dpos, &dstLen, scp + spos, len, small, 0);
+    rc = BZ2_bzBuffToBuffDecompress(dcp + dpos, &dstLen,
+                                    scp + spos, len, small, 0);
     if (rc == BZ_OK)
         return dstLen;
     else if (rc == BZ_OUTBUFF_FULL)
@@ -226,9 +228,9 @@ ACR_BZIP2_EXPORT(jint, Bzip2, b2binflate
     return 0;
 }
 
-ACR_BZIP2_EXPORT(jlong, Bzip2, b2binflate2)(JNI_STDARGS, jlong src,
-                                            jlong dst, jlong dlen,
-                                            jlong len, jboolean small)
+ACR_BZIP2_EXPORT(jlong, Bzip2, inflate2)(JNI_STDARGS, jlong src,
+                                         jlong dst, jlong dlen,
+                                         jlong len, jboolean small)
 {
     unsigned int dstLen;
     char *scp = J2P(src, char *);
@@ -256,14 +258,14 @@ ACR_BZIP2_EXPORT(jlong, Bzip2, b2binflat
     return 0;
 }
 
-ACR_BZIP2_EXPORT(jint, Libbzip2, bzsize0)(JNI_STDARGS)
+ACR_BZIP2_EXPORT(jint, Bzip2Impl, bzsize0)(JNI_STDARGS)
 {
     int ssize  = ISIZEOF(acr_bzstream);
     ACR_BZSIZE = ACR_ALIGN_DEFAULT(ssize);
     return ACR_BZSIZE;
 }
 
-ACR_BZIP2_EXPORT(jlong, Libbzip2, newStream)(JNI_STDARGS, jint bsize)
+ACR_BZIP2_EXPORT(jlong, Bzip2Impl, newStream)(JNI_STDARGS, jint bsize)
 {
     acr_bzstream *s;
     s = ACR_EALLOC(acr_bzstream, bsize);
@@ -272,10 +274,10 @@ ACR_BZIP2_EXPORT(jlong, Libbzip2, newStr
     return P2J(s);
 }
 
-ACR_BZIP2_EXPORT(jint, Libbzip2, compressInit)(JNI_STDARGS,
-                                               jlong stream,
-                                               jint blockSize100k,
-                                               jint workFactor)
+ACR_BZIP2_EXPORT(jint, Bzip2Impl, compressInit)(JNI_STDARGS,
+                                                jlong stream,
+                                                jint blockSize100k,
+                                                jint workFactor)
 {
     int rc;
     acr_bzstream *s = J2P(stream, acr_bzstream *);
@@ -287,8 +289,8 @@ ACR_BZIP2_EXPORT(jint, Libbzip2, compres
     return rc;
 }
 
-ACR_BZIP2_EXPORT(jlong, Libbzip2, decompressInit)(JNI_STDARGS, jlong stream,
-                                                  jboolean small)
+ACR_BZIP2_EXPORT(jlong, Bzip2Impl, decompressInit)(JNI_STDARGS, jlong stream,
+                                                   jboolean small)
 {
     int rc;
     acr_bzstream *s = J2P(stream, acr_bzstream *);
@@ -301,8 +303,8 @@ ACR_BZIP2_EXPORT(jlong, Libbzip2, decomp
 }
 
 
-ACR_BZIP2_EXPORT(jint, Libbzip2, setInput0)(JNI_STDARGS, jlong stream,
-                                           jbyteArray src, jint off, jint len)
+ACR_BZIP2_EXPORT(jint, Bzip2Impl, setInput0)(JNI_STDARGS, jlong stream,
+                                            jbyteArray src, jint off, jint len)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
 
@@ -316,8 +318,8 @@ ACR_BZIP2_EXPORT(jint, Libbzip2, setInpu
     return BZ_OK;
 }
 
-ACR_BZIP2_EXPORT(jint, Libbzip2, setInput1)(JNI_STDARGS, jlong stream,
-                                            jobject src, jint off, jint len)
+ACR_BZIP2_EXPORT(jint, Bzip2Impl, setInput1)(JNI_STDARGS, jlong stream,
+                                             jobject src, jint off, jint len)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
 
@@ -330,8 +332,8 @@ ACR_BZIP2_EXPORT(jint, Libbzip2, setInpu
     return BZ_OK;
 }
 
-ACR_BZIP2_EXPORT(jint, Libbzip2, setInput2)(JNI_STDARGS, jlong stream,
-                                            jlong src, jlong len)
+ACR_BZIP2_EXPORT(jint, Bzip2Impl, setInput2)(JNI_STDARGS, jlong stream,
+                                             jlong src, jlong len)
 {
     int rc = BZ_PARAM_ERROR;
     acr_bzstream *s = J2P(stream, acr_bzstream *);
@@ -346,7 +348,7 @@ ACR_BZIP2_EXPORT(jint, Libbzip2, setInpu
     return rc;
 }
 
-ACR_BZIP2_EXPORT(void, Libbzip2, setInput3)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(void, Bzip2Impl, setInput3)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
 
@@ -356,7 +358,7 @@ ACR_BZIP2_EXPORT(void, Libbzip2, setInpu
     s->bz.avail_in = s->blen;    
 }
 
-ACR_BZIP2_EXPORT(jlong, Libbzip2, getTotalIn)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jlong, Bzip2Impl, getTotalIn)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
     jlong rv = (jlong)s->bz.total_in_hi32 << 32 | (jlong)s->bz.total_in_lo32;
@@ -364,25 +366,25 @@ ACR_BZIP2_EXPORT(jlong, Libbzip2, getTot
     return rv;
 }
 
-ACR_BZIP2_EXPORT(jlong, Libbzip2, getTotalOut)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jlong, Bzip2Impl, getTotalOut)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
     return (jlong)s->bz.total_out_hi32 << 32 | (jlong)s->bz.total_out_lo32;
 }
 
-ACR_BZIP2_EXPORT(jint, Libbzip2, getAvailIn)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jint, Bzip2Impl, getAvailIn)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
     return s->bz.avail_in;
 }
 
-ACR_BZIP2_EXPORT(jlong, Libbzip2, getAvailOut)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jlong, Bzip2Impl, getAvailOut)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
     return (jlong)s->bz.avail_out;
 }
 
-ACR_BZIP2_EXPORT(jboolean, Libbzip2, needsInput)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jboolean, Bzip2Impl, needsInput)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
 
@@ -392,7 +394,7 @@ ACR_BZIP2_EXPORT(jboolean, Libbzip2, nee
         return JNI_FALSE;
 }
 
-ACR_BZIP2_EXPORT(jboolean, Libbzip2, flush)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jboolean, Bzip2Impl, flush)(JNI_STDARGS, jlong stream)
 {
     jboolean rv = JNI_FALSE;
     acr_bzstream *s = J2P(stream, acr_bzstream *);
@@ -404,7 +406,7 @@ ACR_BZIP2_EXPORT(jboolean, Libbzip2, flu
     return rv;
 }
 
-ACR_BZIP2_EXPORT(jboolean, Libbzip2, finish)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jboolean, Bzip2Impl, finish)(JNI_STDARGS, jlong stream)
 {
     jboolean rv = JNI_FALSE;
     acr_bzstream *s = J2P(stream, acr_bzstream *);
@@ -416,7 +418,7 @@ ACR_BZIP2_EXPORT(jboolean, Libbzip2, fin
     return rv;
 }
 
-ACR_BZIP2_EXPORT(jboolean, Libbzip2, finished)(JNI_STDARGS, jlong stream)
+ACR_BZIP2_EXPORT(jboolean, Bzip2Impl, finished)(JNI_STDARGS, jlong stream)
 {
     acr_bzstream *s = J2P(stream, acr_bzstream *);
     return s->eos;
@@ -496,7 +498,7 @@ ACR_BZIP2_EXPORT(jint, Bzip2Deflater, de
         return -1;
     next_out = (*env)->GetDirectBufferAddress(env, buf);
     if (next_out == 0) {
-        ACR_THROW_MSG(ACR_EX_EINVAL, 0);
+        ACR_THROW(ACR_EX_ENULL, 0);
         return -1;
     }
 
@@ -611,7 +613,7 @@ ACR_BZIP2_EXPORT(jint, Bzip2Inflater, in
         return -1;
     next_out = (*env)->GetDirectBufferAddress(env, buf);
     if (next_out == 0) {
-        ACR_THROW_MSG(ACR_EX_EINVAL, 0);
+        ACR_THROW(ACR_EX_ENULL, 0);
         return -1;
     }
 



Mime
View raw message