From f02b2ed0c16c74c91ccbad4135decc90340ef2c7 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Thu, 31 Mar 2011 22:40:52 +0000 Subject: [PATCH] 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 --- .../org/apache/cassandra/io/util/BufferedRandomAccessFile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java b/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java index a36fd1ace7..7317d1d1af 100644 --- a/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java +++ b/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java @@ -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;