Converts buffer offset to file offset
@param offset The offset relative to the buffer @return The offset relative to the whole file
int toFileOffset(int offset) { return currentOffset + offset; }