示例#1
0
        public Pfs(IStorage storage)
        {
            using (var reader = new BinaryReader(storage.AsStream(), Encoding.Default, true))
            {
                Header = new PfsHeader(reader);
            }

            HeaderSize  = Header.HeaderSize;
            Files       = Header.Files;
            FileDict    = Header.Files.ToDictionary(x => x.Name, x => x);
            BaseStorage = storage;
        }
示例#2
0
        public Pfs(Stream stream)
        {
            using (var reader = new BinaryReader(stream, Encoding.Default, true))
            {
                Header = new PfsHeader(reader);
            }

            HeaderSize   = Header.HeaderSize;
            Files        = Header.Files;
            FileDict     = Header.Files.ToDictionary(x => x.Name, x => x);
            StreamSource = new SharedStreamSource(stream);
        }