@Override
	public ByteProvider getByteProvider(GFile file, TaskMonitor monitor)
			throws IOException, CancelledException {

		GFile resolvedFile = fsIndex.resolveSymlinks(file);
		TarMetadata tmd = fsIndex.getMetadata(resolvedFile);
		if (tmd == null) {
			throw new IOException("Unknown file " + file);
		}

		ByteProvider fileBP = fsService.getDerivedByteProvider(provider.getFSRL(),
			resolvedFile.getFSRL(), resolvedFile.getPath(), tmd.tarArchiveEntry.getSize(), () -> {
				TarArchiveInputStream tarInput = new TarArchiveInputStream(provider.getInputStream(0));

				int fileNum = 0;
				TarArchiveEntry tarEntry;
				while ((tarEntry = tarInput.getNextEntry()) != null) {
					if (fileNum == tmd.fileNum) {
						if (!tmd.tarArchiveEntry.getName().equals(tarEntry.getName())) {
							throw new IOException(
								"Mismatch between filenum and tarEntry for " + resolvedFile);
						}
						return tarInput;
					}
					fileNum++;
				}
				throw new IOException("Could not find requested file " + resolvedFile);
			}, monitor);

		return fileBP;
	}
Creates a new TarFileSystem instance.

@param fsrl {@link FSRLRoot} of the new filesystem.
@param provider {@link ByteProvider} container file
@param fsService reference to the {@link FileSystemService}.
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/tar/TarFileSystem.java