public override DiscUtils.FileSystemInfo[] Detect(Stream stream, VolumeInfo volume) { if (SquashFileSystemReader.Detect(stream)) { return(new DiscUtils.FileSystemInfo[] { new VfsFileSystemInfo("SquashFS", "Squash Filesystem", Open) }); } return(new DiscUtils.FileSystemInfo[0]); }
public void Detect() { MemoryStream ms = new MemoryStream(new byte[1000]); Assert.IsFalse(SquashFileSystemReader.Detect(ms)); ms = new MemoryStream(new byte[10]); Assert.IsFalse(SquashFileSystemReader.Detect(ms)); MemoryStream emptyFs = new MemoryStream(); SquashFileSystemBuilder builder = new SquashFileSystemBuilder(); builder.Build(emptyFs); Assert.IsTrue(SquashFileSystemReader.Detect(emptyFs)); }