mirror of https://github.com/apache/cassandra
Merge CASSANDRA-2417 from 0.7
git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1089140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a234853e5a
commit
a25f730005
|
|
@ -113,9 +113,9 @@ public class MappedFileDataInput extends AbstractDataInput implements FileDataIn
|
|||
public synchronized ByteBuffer readBytes(int length) throws IOException
|
||||
{
|
||||
int remaining = buffer.remaining() - position;
|
||||
|
||||
assert length <= remaining
|
||||
: String.format("mmap segment underflow; remaining is %d but %d requested", remaining, length);
|
||||
if (length > remaining)
|
||||
throw new IOException(String.format("mmap segment underflow; remaining is %d but %d requested",
|
||||
remaining, length));
|
||||
|
||||
ByteBuffer bytes = buffer.duplicate();
|
||||
bytes.position(buffer.position() + position).limit(buffer.position() + position + length);
|
||||
|
|
|
|||
Loading…
Reference in New Issue