Author: stliu
Date: 2010-11-11 21:43:58 -0500 (Thu, 11 Nov 2010)
New Revision: 20865
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/bytecode/util/ByteCodeHelper.java
Log:
JBPAPP-5409 HHH-5453 ByteCodeHelper.readByteCode won't load classes bigger than a
constant size
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/bytecode/util/ByteCodeHelper.java
===================================================================
---
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/bytecode/util/ByteCodeHelper.java 2010-11-12
02:42:25 UTC (rev 20864)
+++
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/bytecode/util/ByteCodeHelper.java 2010-11-12
02:43:58 UTC (rev 20865)
@@ -33,15 +33,15 @@
byte[] buffer = new byte[409600];
byte[] classBytes = new byte[0];
- int r = 0;
try {
- r = inputStream.read( buffer );
+ int r = inputStream.read( buffer );
while ( r >= buffer.length ) {
byte[] temp = new byte[ classBytes.length + buffer.length ];
System.arraycopy( classBytes, 0, temp, 0, classBytes.length );
System.arraycopy( buffer, 0, temp, classBytes.length, buffer.length );
classBytes = temp;
+ r = inputStream.read( buffer );
}
if ( r != -1 ) {
byte[] temp = new byte[ classBytes.length + r ];
Show replies by date