private int processTailEnd(SquashedFile squashedFile, SquashBasicFileInode fileInode,
			OutputStream os, TaskMonitor monitor) throws CancelledException, IOException {

		SquashFragment fragment = squashedFile.getFragment();

		byte[] buffer = null;

		if (fragment.isCompressed()) {

			// Set the pointer to where (relative to the start of the archive) the fragment starts
			reader.setPointerIndex(fragment.getFragmentOffset());

			// Decompress the fragment into a byte array
			buffer = SquashUtils.decompressBytes(reader, (int) fragment.getFragmentSize(),
				superBlock.getCompressionType(), monitor);

			// Remove non-relevant portion of the fragment block
			buffer = Arrays.copyOfRange(buffer, fileInode.getBlockOffset(),
				fileInode.getBlockOffset() + fileInode.getTailEndSize());
		}
		else {
			// Set the pointer to start of the tail end of file within the fragment
			reader.setPointerIndex(fragment.getFragmentOffset() + fileInode.getBlockOffset());

			// Read only relevant the portion of the fragment
			buffer = reader.readNextByteArray(fileInode.getTailEndSize());
		}

		// Write to the output and increment progress
		os.write(buffer);
		return buffer.length;
	}
Decompress (if needed) the tail end of the given file and write to OutputStream
@param squashedFile The file to process
@param fileInode The inode associated with the file
@param os The stream to write to
@param monitor The monitor to keep track of the progress with
@return The number of uncompressed bytes the tail end used
@throws CancelledException The user cancelled the file read
@throws IOException Any read error
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/squashfs/SquashFileSystem.java