Esempio n. 1
0
        internal Stream GetFolderStream(Stream stream, CFolder folder, IPasswordProvider pw)
        {
            int         packStreamIndex    = folder.FirstPackStreamId;
            long        folderStartPackPos = GetFolderStreamPos(folder, 0);
            List <long> packSizes          = new List <long>();

            for (int j = 0; j < folder.PackStreams.Count; j++)
            {
                packSizes.Add(PackSizes[packStreamIndex + j]);
            }

            return(DecoderStreamHelper.CreateDecoderStream(stream, folderStartPackPos, packSizes.ToArray(), folder, pw));
        }
Esempio n. 2
0
        internal long GetFolderFullPackSize(int folderIndex)
        {
            int     packStreamIndex = Folders[folderIndex].FirstPackStreamId;
            CFolder folder          = Folders[folderIndex];

            long size = 0;

            for (int i = 0; i < folder.PackStreams.Count; i++)
            {
                size += PackSizes[packStreamIndex + i];
            }

            return(size);
        }
Esempio n. 3
0
        internal long GetFolderStreamPos(CFolder folder, int indexInFolder)
        {
            int index = folder.FirstPackStreamId + indexInFolder;

            return(DataStartPosition + PackStreamStartPositions[index]);
        }