RandomAccessFile.java (seek): Let seek go past end of file.

* java/io/RandomAccessFile.java (seek): Let seek go past end of
	file.
	(skipBytes): Don't fail if seeking past end of file.
	* java/io/FileInputStream.java (skip): Don't fail if seeking past
	end of file.
	* java/io/natFileDescriptorWin32.cc (seek): Handle `eof_trunc'
	argument.
	* java/io/natFileDescriptorEcos.cc (seek): Handle `eof_trunc'
	argument.
	* java/io/natFileDescriptorPosix.cc (seek): Handle `eof_trunc'
	argument.
	* java/io/FileDescriptor.java (seek): Added `eof_trunc' argument.

From-SVN: r44586
This commit is contained in:
Tom Tromey 2001-08-02 23:46:39 +00:00 committed by Tom Tromey
parent ead4cf347a
commit 8d6a437584
7 changed files with 43 additions and 23 deletions

View file

@ -1,6 +1,6 @@
// RandomAccessFile.java
/* Copyright (C) 1998, 1999 Free Software Foundation
/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@ -161,12 +161,12 @@ public class RandomAccessFile implements DataOutput, DataInput
public void seek (long pos) throws IOException
{
fd.seek(pos, FileDescriptor.SET);
fd.seek(pos, FileDescriptor.SET, false);
}
public int skipBytes (int count) throws IOException
{
return fd.seek(count, FileDescriptor.CUR);
return count <= 0 ? 0 : fd.seek(count, FileDescriptor.CUR, true);
}
public void write (int oneByte) throws IOException