From c8ca83836a906eee2aa59c8694dd5e3757cc0555 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 22 Jan 2013 20:25:37 +0100 Subject: [PATCH] Fix RAF --- classpath/java/io/RandomAccessFile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classpath/java/io/RandomAccessFile.java b/classpath/java/io/RandomAccessFile.java index 18bacb99f3..da9a8356b6 100644 --- a/classpath/java/io/RandomAccessFile.java +++ b/classpath/java/io/RandomAccessFile.java @@ -108,7 +108,8 @@ public class RandomAccessFile { int n = 0; do { int count = readBytes(peer, position, b, off + n, len - n); - if (count < 0) + position += count; + if (count == 0) throw new EOFException(); n += count; } while (n < len);