示例#1
0
        /// <summary>
        /// Decodes the children of this chunk
        /// </summary>
        /// <param name="reader"></param>
        private void ReadChildren(DjvuReader reader)
        {
            List <IFFChunk> children = new List <IFFChunk>();

            // Read in all the chunks
            while (reader.Position < Offset + Length + 8)
            {
                if (reader.Position % 2 == 1)
                {
                    reader.Position++;
                }

                // Read the chunk ID
                string     id   = reader.ReadUTF8String(4);
                ChunkTypes type = IFFChunk.GetChunkType(id);

                // Reset the stream position
                reader.Position -= 4;

                var chunk = IFFChunk.BuildIFFChunk(reader, Document, this, type);

                if (chunk != null)
                {
                    children.Add(chunk);
                }
            }

            Children = children.ToArray();
        }
示例#2
0
        /// <summary>
        /// Reads in the chunk data
        /// </summary>
        /// <param name="reader"></param>
        private void ReadChunkHeader(DjvuReader reader)
        {
            ChunkID = reader.ReadUTF8String(4);

            if (IsSubFormChunk == false)
            {
                Length = reader.ReadInt32MSB();
            }
        }
示例#3
0
        /// <summary>
        /// Loads the bookmark data
        /// </summary>
        /// <param name="reader"></param>
        private void DecodeBookmarkData(DjvuReader reader)
        {
            int childrenCount = reader.ReadByte();

            int textSize = reader.ReadInt24MSB();

            Name = reader.ReadUTF8String(textSize);

            int urlSize = reader.ReadInt24MSB();

            URL = reader.ReadUTF8String(urlSize);

            // Read in all the children bookmarks
            List <Bookmark> children = new List <Bookmark>();

            for (int x = 0; x < childrenCount; x++)
            {
                children.Add(new Bookmark(reader, Document, this));
            }
            _children = children.ToArray();
        }
示例#4
0
        /// <summary>
        /// Decodes the children of this chunk
        /// </summary>
        /// <param name="reader"></param>
        private void ReadChildren(DjvuReader reader)
        {
            List<IFFChunk> children = new List<IFFChunk>();

            // Read in all the chunks
            while (reader.Position < Offset + Length + 8)
            {
                if (reader.Position % 2 == 1)
                {
                    reader.Position++;
                }

                // Read the chunk ID
                string id = reader.ReadUTF8String(4);
                ChunkTypes type = IFFChunk.GetChunkType(id);

                // Reset the stream position
                reader.Position -= 4;

                var chunk = IFFChunk.BuildIFFChunk(reader, Document, this, type);

                if (chunk != null)
                {
                    children.Add(chunk);
                }
            }

            Children = children.ToArray();
        }
示例#5
0
 protected override void ReadChunkData(DjvuReader reader)
 {
     _includeID = reader.ReadUTF8String(Length);
 }
示例#6
0
        /// <summary>
        /// Loads the bookmark data
        /// </summary>
        /// <param name="reader"></param>
        private void DecodeBookmarkData(DjvuReader reader)
        {
            int childrenCount = reader.ReadByte();

            int textSize = reader.ReadInt24MSB();
            Name = reader.ReadUTF8String(textSize);

            int urlSize = reader.ReadInt24MSB();
            URL = reader.ReadUTF8String(urlSize);

            // Read in all the children bookmarks
            List<Bookmark> children = new List<Bookmark>();
            for (int x = 0; x < childrenCount; x++)
            {
                children.Add(new Bookmark(reader, Document, this));
            }
            _children = children.ToArray();
        }
示例#7
0
 protected override void ReadChunkData(DjvuReader reader)
 {
     _includeID = reader.ReadUTF8String(Length);
 }