if (mapN > mappedBuffers.length) // we have run out of data to read from
break;
MappedByteBuffer currentBuffer = mappedBuffers[mapN];
if (offN > currentBuffer.limit())
break;
currentBuffer.position(offN);
int bytesFromThisBuffer = Math.min(len, currentBuffer.remaining());
currentBuffer.get(bytes, off, bytesFromThisBuffer);
off += bytesFromThisBuffer;
pos += bytesFromThisBuffer;
totalRead += bytesFromThisBuffer;