add seek position, fileLength too

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1087470 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2011-03-31 22:40:52 +00:00
parent cd1b798fa8
commit f02b2ed0c1
1 changed files with 2 additions and 1 deletions

View File

@ -338,7 +338,8 @@ public class BufferedRandomAccessFile extends RandomAccessFile implements FileDa
throw new IllegalArgumentException("new position should not be negative");
if (isReadOnly() && newPosition > fileLength)
throw new EOFException("unable to seek past the end of " + filePath + " in read-only mode.");
throw new EOFException(String.format("unable to seek to position %d in %s (%d bytes) in read-only mode",
newPosition, filePath, fileLength));
current = newPosition;