public static byte[] decompressBytes(BinaryReader reader, int length, int compressionType,
			TaskMonitor monitor) throws IOException, CancelledException {

		// Check if the user cancelled the load
		monitor.checkCancelled();

		// Create InputStream containing ONLY the source compressed bytes
		InputStream is = getSubInputStream(reader, length);

		// Convert the InputStream into a decompression stream
		try (InputStream decompressedInputStream = getDecompressionStream(is, compressionType)) {

			// Decompress and return all bytes from the stream
			return decompressedInputStream.readAllBytes();
		}
		finally {
			is.close();
		}
	}
Decompress the given bytes
@param reader A BinaryReader pointed at the start of the bytes to be decompressed
@param length The amount of bytes to decompress
@param compressionType The type of compression being used by the archive
@param monitor Monitor to allow the user to cancel the load
@return A byte array containing the decompressed bytes
@throws IOException Any kind of decompression/read error
@throws CancelledException Archive load was cancelled
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/squashfs/SquashUtils.java