gitlabEdit

computerHow to use

How do I use this library?

Metalink files contain metadata about a file, such as hashes, chunks, and other information to help download managers accelerate its download while verifying the checksum to avoid corruption.


You can easily parse both Metalink 3.0 and 4.0 files, streams, and XML representations using the MetalinkParser class.

This is very easy; just call one of these functions when assigning a variable that will hold Metalink-related data, and you'll be able to get information about the file, such as hashes, chunks and their info, and regions for mirrors.


Here's a very simple example of how to do this using a file stream:

// Note that MetalinkLoader is not part of the library
Stream? stream = MetalinkLoader.LoadMetalinkStream("slackware15.iso.metalink");
if (stream is null)
    Assert.Fail("Stream is null");
var metalink = MetalinkParser.GetMetalinkFromStream(stream);

Last updated