Пример #1
0
        /// <summary>
        /// Parses a sub stream.
        /// </summary>
        /// <returns></returns>
        SType ParseSubStream()
        {
            SType subStream = new SStreamType(StreamType.SubStream);
            var   length    = m_reader.ReadLength();

            if (s_dumpStructure)
            {
                var subReader = new CachedFileReader(m_reader, length);
                var subParser = new CachedFileParser(subReader);
                subParser.Parse();
                subStream.AddMember(subParser.m_stream.Clone());
            }

            if (s_cachedObject)
            {
                return(new SStringType(m_reader.ReadString(length)));
            }

            m_reader.Seek(length);

            return(subStream);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CachedFileParser"/> class.
 /// </summary>
 /// <param name="reader">The reader.</param>
 CachedFileParser(CachedFileReader reader)
 {
     m_reader = reader;
     m_stream = new SStreamType(StreamType.StreamStart);
 }