Meshbeyn / Projects

namespace NTFSExtensions

public static class Compression

GetZeroRanges

Returns an enumeration of unallocated regions in a stream.

Signatures

Parameters

this FileStream File
A FileStream object as a reference to opened stream. You may call this method directly from this object, because this is an extension method.

Returns

If the stream is compressed or sparse, function calculates and returns an enumeration of unallocated regions. If stream is saved as plain data, no unallocated regions may exist.

Remarks

Scans a file or alternate stream looking for ranges that contain unallocated clusters. Only compressed or sparse files can have unallocated ranges known to the operating system. For other files, the enumeration is always empty.

Example

Example for working with sparse streams

See also