/// <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(); }
/// <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(); } }
/// <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(); }
/// <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(); }
protected override void ReadChunkData(DjvuReader reader) { _includeID = reader.ReadUTF8String(Length); }
/// <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(); }