public void extractFileToStream(OutputStream os, GFile file, TaskMonitor monitor)
			throws IOException, CancelledException {

		// If the current file is a symlink, try to follow it
		file = fsIndex.resolveSymlinks(file);

		SquashedFile squashedFile = fsIndex.getMetadata(file);

		if (squashedFile == null) {
			throw new IOException("Could not find SquashedFile associated with the symlink target");
		}

		// Stop if the associated inode is not a file
		SquashInode inode = squashedFile.getInode();
		if (!(inode.isFile())) {
			throw new IOException("Inode is not a file");
		}

		// Get the associated file inode
		SquashBasicFileInode fileInode = (SquashBasicFileInode) inode;

		// Keep track of the total number of decompressed bytes for progress tracking reasons
		long totalUncompressedBytes = 0;

		// Set the monitor's completion point to be all bytes processed
		monitor.initialize(fileInode.getFileSize());

		// Process all the blocks comprising the file
		totalUncompressedBytes += processFileBlocks(squashedFile, fileInode, os, monitor);

		// Grab the tail end of the file if it exists
		if (squashedFile.hasFragment()) {
			totalUncompressedBytes += processTailEnd(squashedFile, fileInode, os, monitor);
		}

		// Monitor should be 100% at this point
		monitor.setProgress(totalUncompressedBytes);
	}
Convert the given SquashFS file into a stream of bytes
@param os The stream to write file data to
@param file The file to convert
@param monitor Monitor to allow the user to cancel the load
@throws IOException Any read operation failure
@throws CancelledException File load was cancelled
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/squashfs/SquashFileSystem.java