webwork/src/main/webwork/util ClassLoaderUtils.java,1.1,1.2

[email protected] Sun, 09 Nov 2003 12:56:13 -0800
Newsgroups gmane.comp.java.open-symphony.cvs
Message-ID <[email protected]>
Update of /cvsroot/opensymphony/webwork/src/main/webwork/util
In directory sc8-pr-cvs1:/tmp/cvs-serv26235/src/main/webwork/util

Modified Files:
	ClassLoaderUtils.java 
Log Message:
Added util method used by ww classloader

Index: ClassLoaderUtils.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/util/ClassLoaderUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ClassLoaderUtils.java	24 Jun 2003 04:24:35 -0000	1.1
+++ ClassLoaderUtils.java	9 Nov 2003 20:56:10 -0000	1.2
@@ -1,5 +1,4 @@
 /*
- * Atlassian Source Code Template.
  * User: sfarquhar
  * Date: 8/03/2002
  * Time: 17:37:41
@@ -141,5 +140,18 @@
         {
             printClassLoader(cl.getParent());
         }
+    }
+
+    public static byte[] readStream(InputStream in, int size) throws IOException
+    {
+        if(in == null) return null;
+       if(size == 0) return new byte[0];
+       int currentTotal = 0;
+       int bytesRead;
+       byte[] data = new byte[size];
+       while(currentTotal < data.length && (bytesRead = in.read(data, currentTotal, data.length - currentTotal)) >= 0)
+         currentTotal += bytesRead;
+       in.close();
+       return data;
     }
 }




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/