/// <summary> /// Extract file referenced by <paramref name="entry"/> into current directory. /// </summary> public void Extract(ArcFile file, Entry entry) { using (var input = OpenEntry(file, entry)) using (var output = PhysicalFileSystem.CreateFile(entry.Name)) input.CopyTo(output); }
/// <summary> /// Open <paramref name="entry"> as image. Throws InvalidFormatException if entry is not an image. /// </summary> public virtual IImageDecoder OpenImage(ArcFile arc, Entry entry) { var input = arc.OpenBinaryEntry(entry); return(ImageFormatDecoder.Create(input)); }
/// <summary> /// Open file referenced by <paramref name="entry"/> as Stream. /// </summary> public virtual Stream OpenEntry(ArcFile arc, Entry entry) { return(arc.File.CreateStream(entry.Offset, entry.Size, entry.Name)); }