adding index offset on read / write file streams