updated InMemoryFile to support distinct read and write access without mixing up positions and stuff

This commit is contained in:
Sebastian Stenzel
2015-12-29 21:58:47 +01:00
parent 6acbba476b
commit c86068d7bb
4 changed files with 173 additions and 80 deletions
@@ -31,7 +31,7 @@ public final class ByteBuffers {
final ByteBuffer tmp = source.asReadOnlyBuffer();
tmp.limit(tmp.position() + numBytes);
destination.put(tmp);
source.position(tmp.position());
source.position(tmp.position()); // until now only tmp pos has been incremented, so we need to adjust the position
return numBytes;
}