Message562
Logged In: YES
user_id=117665
I'm uncomfortable with a couple of aspects of this patch -
the use of a member variable 'buf' makes the class loading
process not thread safe (can ClassLoaders be used in
multiple threads?). Also, this will retain a buffer as large
as the largest class loaded in the process.
It would probably be better to have a getBytes method
something like:
protected byte[] getBytes( InputStream s )
{
int bufsize=4096;
byte[] buf = new byte[ bufsize ];
ByteArrayOutputStream out = new ByteArrayOutputStream(
bufsize );
int count;
while( true )
{
count = in.read( buf, 0, bufsize );
if ( count < 0 )
break;
out.write( buf, 0, count );
}
return out.getBytes();
}
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:00 | admin | link | issue511493 messages |
2008-02-20 17:17:00 | admin | create | |
|