private static void processExtents(BinaryReader reader, ByteProvider provider,
			RangeMappedByteProvider ebp, int blockSize, long expectedLength) throws IOException {
		Ext4ExtentHeader header = Ext4ExtentHeader.read(reader);
		if ( header == null ) {
			throw new IOException("Bad/missing extents header");
		}
		if (header.getEh_depth() == 0) {
			for (int i = 0; i < header.getEh_entries() && ebp.length() < expectedLength; i++) {
				Ext4Extent extent = new Ext4Extent(reader);
				
				long startPos = extent.getStreamBlockNumber() * blockSize;
				long providerOfs = extent.getExtentStartBlockNumber() * blockSize;
				long extentLen = extent.getExtentBlockCount() * blockSize;
				if (ebp.length() < startPos) {
					ebp.addSparseRange(startPos - ebp.length());
				}
				if (ebp.length() + extentLen > expectedLength) {
					// the last extent may have a trailing partial block
					extentLen = expectedLength - ebp.length();
				}

				ebp.addRange(providerOfs, extentLen);
			}
		}
		else {
			for (int i = 0; i < header.getEh_entries(); i++) {
				Ext4ExtentIdx idx = new Ext4ExtentIdx(reader);
				long offset = idx.getEi_leaf() * blockSize;
				try (ByteProviderWrapper bpw =
					new ByteProviderWrapper(provider, offset, blockSize)) {
					BinaryReader subReader = new BinaryReader(bpw, true /* LE */);
					processExtents(subReader, provider, ebp, blockSize, expectedLength);
				}
			}
		}

	}
Creates a {@link RangeMappedByteProvider} from the extents data found in the
inode's i_block field.
  
@param rawIBlockBytes raw bytes from the inode's i_block
@param provider the file system volume provider
@param expectedLength the length the file should be (from the inode)
@param blockSize file system blockSize 
@param fsrl {@link FSRL} to assign to the new ByteProvider
@return new {@link ByteProvider} containing the blocks of the volume that were specified
by the extent data
@throws IOException if error
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ext4/Ext4ExtentsHelper.java