Пример #1
0
 /// <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);
 }
Пример #2
0
        /// <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));
        }
Пример #3
0
 /// <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));
 }