commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mart...@apache.org
Subject svn commit: r349360 - /jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
Date Mon, 28 Nov 2005 04:18:22 GMT
Author: martinc
Date: Sun Nov 27 20:18:20 2005
New Revision: 349360

URL: http://svn.apache.org/viewcvs?rev=349360&view=rev
Log:
Minor simplification to write().

Modified:
    jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java

Modified: jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java?rev=349360&r1=349359&r2=349360&view=diff
==============================================================================
--- jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
(original)
+++ jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
Sun Nov 27 20:18:20 2005
@@ -77,12 +77,6 @@
     public static final String DEFAULT_CHARSET = "ISO-8859-1";
 
 
-    /**
-     * Size of buffer to use when writing an item to disk.
-     */
-    private static final int WRITE_BUFFER_SIZE = 2048;
-
-
     // ----------------------------------------------------------- Data members
 
 
@@ -407,11 +401,7 @@
                             new FileInputStream(outputFile));
                         out = new BufferedOutputStream(
                                 new FileOutputStream(file));
-                        byte[] bytes = new byte[WRITE_BUFFER_SIZE];
-                        int s = 0;
-                        while ((s = in.read(bytes)) != -1) {
-                            out.write(bytes, 0, s);
-                        }
+                        CopyUtils.copy(in, out);
                     } finally {
                         if (in != null) {
                             try {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message