This commit is contained in:
Sebastian Stenzel
2015-12-19 11:26:35 +01:00
parent 69b192fe82
commit 951a02a9a5
14 changed files with 42 additions and 95 deletions
@@ -57,8 +57,11 @@ class InMemoryFile extends InMemoryNode implements File, ReadableFile, WritableF
}
@Override
public void read(ByteBuffer target, int position) {
content.position(position);
public void read(ByteBuffer target, long position) {
if (position > Integer.MAX_VALUE) {
throw new IllegalArgumentException("Can not keep files of virtually unlimited size in memory.");
}
content.position((int) position);
ByteBuffers.copy(content, target);
}