code: void rollIfNeeded() throws IOException {
      if (numberOfParts == 1 || numberOfFiles < 1) {
        return;
      }
      filesCount++;
      if (filesCount % filesPerRoll == 0) {
        out.close();
        currentPart++;
        createOutputStream();
      }
    }
docs: Close current segment and start a new one if needed