Files.FAR3.FAR3Archive.GrabEntry C# (CSharp) Метод

GrabEntry() публичный Метод

Returns an entry in this archive as a Stream instance. Throws a FAR3Exception if entry was not found.
public GrabEntry ( ulong ID ) : Stream
ID ulong ID of the entry to grab from archive.
Результат Stream
        public Stream GrabEntry(ulong ID)
        {
            m_FinishedReading.WaitOne();

            if (!ContainsEntry(ID))
                throw new FAR3Exception("Couldn't find entry - FAR3Archive.cs!");

            FAR3Entry Entry = m_Entries[ID];

            lock (m_Reader)
            {
                m_Reader.Seek((long)Entry.DataOffset);

                switch (Entry.TypeID)
                {
                    case 1: //BMP
                    case 2: //TGA
                    case 5: //SKEL
                    case 7: //ANIM
                    case 9: //MESH
                    case 11: //BND
                    case 12: //APR
                    case 13: //OFT
                    case 15: //PO
                    case 16: //COL
                    case 18: //HAG
                    case 20: //JPG
                    case 24: //PNG
                        return Decompress(Entry);
                    case 14: //PNG, uncompressed
                    default:
                        MemoryStream MemStream = new MemoryStream(m_Reader.ReadBytes((int)Entry.DecompressedDataSize));
                        MemStream.Seek(0, SeekOrigin.Begin);
                        return MemStream;
                }
            }
        }