示例#1
0
文件: ZimReader.cs 项目: DanWBR/Zim
        private Article GetArticle(DirectoryEntry DE)
        {
            Article A = new Article();

            A.DirectoryEntry = DE;

            ArticleCluster AC = GetArticleCluster(DE.Cluster);

            A.Body = AC.Blobs[DE.Blob];
            return(A);
        }
示例#2
0
文件: ZimReader.cs 项目: DanWBR/Zim
        private ArticleCluster GetArticleCluster(int ClusterNumber)
        {
            ArticleCluster AC = new ArticleCluster();

            zimFileBinaryReader.BaseStream.Seek(ClusterPointers [ClusterNumber], SeekOrigin.Begin);

            AC.Compression = (ArticleCluster.CompressionType)zimFileBinaryReader.ReadByte();

            switch (AC.Compression)
            {
            case ArticleCluster.CompressionType.LZMA2:
                AC.PopulateArticle(XZ.OpenXZ(zimFileBinaryReader));
                break;

            default:
                AC.PopulateArticle(zimFileBinaryReader.BaseStream);
                break;
            }

            return(AC);
        }
示例#3
0
文件: ZimReader.cs 项目: sambott/Zim
        private ArticleCluster GetArticleCluster(int ClusterNumber)
        {
            ArticleCluster AC = new ArticleCluster ();
            zimFileBinaryReader.BaseStream.Seek (ClusterPointers [ClusterNumber], SeekOrigin.Begin);

            AC.Compression = (ArticleCluster.CompressionType)zimFileBinaryReader.ReadByte ();

            switch (AC.Compression) {

            case ArticleCluster.CompressionType.LZMA2:
                AC.PopulateArticle (XZ.OpenXZ (zimFileBinaryReader));
                break;

            default:
                AC.PopulateArticle (zimFileBinaryReader.BaseStream);
                break;
            }

            return AC;
        }