[armedbear-cvs] r11976 - trunk/abcl/src/org/armedbear/lisp/util

Erik Huelsmann ehuelsmann at common-lisp.net
Mon Jun 1 14:46:00 UTC 2009


Author: ehuelsmann
Date: Mon Jun  1 10:45:54 2009
New Revision: 11976

Log:
Move flushBbuf() related bbufpos modifications into flushBbuf().

Modified:
   trunk/abcl/src/org/armedbear/lisp/util/RandomAccessCharacterFile.java

Modified: trunk/abcl/src/org/armedbear/lisp/util/RandomAccessCharacterFile.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/util/RandomAccessCharacterFile.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/util/RandomAccessCharacterFile.java	Mon Jun  1 10:45:54 2009
@@ -328,7 +328,7 @@
                 bbuf.flip();
                 fcn.position(bbufpos);
                 fcn.write(bbuf);
-                bbufpos = bbufpos+bbuf.position();
+                bbufpos += bbuf.position();
                 bbuf.clear();
             } else {
                 fcn.position(bbufpos + bbuf.limit());
@@ -389,7 +389,6 @@
             }
             if (CoderResult.OVERFLOW == r || bbuf.remaining() == 0) {
                 flushBbuf();
-                bbufpos += bbuf.limit();
                 bbuf.clear();
                 if (bbufpos < fcnsize) {
                     fcn.read(bbuf);
@@ -443,6 +442,10 @@
             bbuf.limit((int)(fcnsize - bbufpos));
         }
         fcn.write(bbuf);
+
+        bbufpos += bbuf.position();
+        bbuf.clear();
+        bbuf.flip(); // there's no useable data in this buffer
         bbufIsDirty = false;
     }
 
@@ -526,7 +529,6 @@
             }
             if (bbuf.remaining() == 0) {
                 flushBbuf();
-                bbufpos += bbuf.limit();
                 bbuf.clear();
                 if (bbufpos < fcnsize) {
                     fcn.position(bbufpos);




More information about the armedbear-cvs mailing list