]> source.dussan.org Git - javassist.git/commitdiff
fixed JASSIST-142
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 25 May 2011 18:03:44 +0000 (18:03 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 25 May 2011 18:03:44 +0000 (18:03 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@581 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/ClassPoolTail.java

index aa1aefe7a8eeaf828ce0ae8fdc2817bda7d4f466..4158b485fbbc3dca23b4489f83547e69f8b7dde2 100644 (file)
@@ -420,8 +420,12 @@ final class ClassPoolTail {
         throws IOException
     {
         int bufsize = 4096;
-        for (int i = 0; i < 8; ++i) {
-            byte[] buf = new byte[bufsize];
+        byte[] buf = null;
+        for (int i = 0; i < 64; ++i) {
+            if (i < 8) {
+                bufsize *= 2;
+                buf = new byte[bufsize];
+            }
             int size = 0;
             int len = 0;
             do {
@@ -434,7 +438,6 @@ final class ClassPoolTail {
                 }
             } while (size < bufsize);
             fout.write(buf);
-            bufsize *= 2;
         }
 
         throw new IOException("too much data");