[armedbear-cvs] r11977 - trunk/abcl/src/org/armedbear/lisp/util
Erik Huelsmann
ehuelsmann at common-lisp.net
Mon Jun 1 15:30:34 UTC 2009
Author: ehuelsmann
Date: Mon Jun 1 11:30:30 2009
New Revision: 11977
Log:
Use a slighly less contrived calculation method to
calculate the buffer window to be written to disk.
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 11:30:30 2009
@@ -435,12 +435,10 @@
fcn.position(bbufpos);
- bbuf.position(0);
- if (bbufpos + bbuf.limit() > fcnsize) {
- // the buffer is at the end of the file.
- // area beyond fcnsize does not have data.
- bbuf.limit((int)(fcnsize - bbufpos));
- }
+ // if the buffer is dirty, the modifications have to be
+ // before position(): before re-positioning, this.position()
+ // calls this function.
+ bbuf.flip();
fcn.write(bbuf);
bbufpos += bbuf.position();
More information about the armedbear-cvs
mailing list