From 749d7725ab7cf8a4133b20f35f0ab62930d70aa5 Mon Sep 17 00:00:00 2001 From: chiba Date: Wed, 25 May 2011 18:03:44 +0000 Subject: [PATCH] fixed JASSIST-142 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@581 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/ClassPoolTail.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/javassist/ClassPoolTail.java b/src/main/javassist/ClassPoolTail.java index aa1aefe7..4158b485 100644 --- a/src/main/javassist/ClassPoolTail.java +++ b/src/main/javassist/ClassPoolTail.java @@ -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"); -- 2.39.5