Meshbeyn / Projects

namespace NTFSExtensions

public static class Compression

SetZeroData

Zeroes (setts all bytes to 0) a region in a stream. If the stream is sparse and the region is big enough to deallocate clusters, some clusters of stream will be deallocated.

Signatures

Parameters

this FileStream FS
A FileStream object as a reference to opened stream. You may call this method directly from this object, because this is an extension method.
SafeFileHandle FileStream
Handle to opened stream. You can become this handle from file stream object or using WinAPI function CreateFile.
Range Range
A Range structure that describes the region.

Remarks

Zeroes (setts all bytes to 0) a region in a stream. If the stream is sparse and the region is big enough to deallocate clusters, some clusters of stream will be deallocated.

Example

Example: working with sparse streams

See also