Index: java/io/RandomAccessFile.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/RandomAccessFile.java,v retrieving revision 1.40 diff -u -b -B -r1.40 RandomAccessFile.java --- java/io/RandomAccessFile.java 1 May 2004 10:40:56 -0000 1.40 +++ java/io/RandomAccessFile.java 28 May 2004 21:44:00 -0000 @@ -210,11 +210,13 @@ */ public void setLength (long newLen) throws IOException { + // FIXME: Extending a file should probably be done by one method call. + // FileChannel.truncate() can only shrink a file. // To expand it we need to seek forward and write at least one byte. if (newLen < length()) ch.truncate (newLen); - else + else if (newLen > length()) { long pos = getFilePointer(); seek(newLen - 1);