Пример #1
0
        public sFsFileInfo LoadFileContent(sFsFileInfo fi)
        {
            var rr = base.ReadPage(fi.StartPage, BinSerializer.ComputeFileSizePerSector(fi.Length, PAGE_SIZE));

            if (rr.Succeeded)
            {
                fi.Buffer = PublicEncryptor.DC(this._pw, rr.Buffer);
                return(fi);
            }
            else
            {
                throw new ApplicationException(string.Format("Cannot read data file content '{0}'", fi.FileName));
            }
        }
        public sFsFileInfo LoadFileContent(sFsFileInfo fi)
        {
            var rr = GetFATWriterReader().ReadFile(fi.StartAddr, (uint)BinSerializer.ComputeFileSizePerSector(fi.Length, (int)GetFATWriterReader().SectorSize));

            if (rr != null)
            {
                fi.Buffer = PublicEncryptor.DC(this._pw, rr).Take(fi.Length).ToArray();
                return(fi);
            }
            else
            {
                throw new ApplicationException(string.Format("Cannot read data file content '{0}'", fi.FileName));
            }
        }