You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/08/08 04:16:06 UTC

svn commit: r1511560 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileOutputStream.java

Author: ggregory
Date: Thu Aug  8 02:16:05 2013
New Revision: 1511560

URL: http://svn.apache.org/r1511560
Log:
[VFS-483][RAM] Many suggestions to improve the RAM file provider. Refactor local data in org.apache.commons.vfs2.provider.ram.RamFileOutputStream.write(byte[], int, int).

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileOutputStream.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileOutputStream.java?rev=1511560&r1=1511559&r2=1511560&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileOutputStream.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileOutputStream.java Thu Aug  8 02:16:05 2013
@@ -59,8 +59,9 @@ public class RamFileOutputStream extends
     @Override
     public void write(final byte[] b, final int off, final int len) throws IOException
     {
-        final int size = this.file.getData().size();
-        final int newSize = this.file.getData().size() + len;
+        final RamFileData data = this.file.getData();
+        final int size = data.size();
+        final int newSize = size + len;
         // Store the Exception in order to notify the client again on close()
         try
         {
@@ -71,7 +72,7 @@ public class RamFileOutputStream extends
             this.exception = e;
             throw e;
         }
-        System.arraycopy(b, off, this.file.getData().getContent(), size, len);
+        System.arraycopy(b, off, data.getContent(), size, len);
     }
 
     /*